[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bawden's Alternate Proposal



	
    Date: 23 Jul 86 00:44 PDT
    From: masinter.pa@Xerox.COM
    To: common-lisp@SU-AI.ARPA
    Subject: Re: Bawden's Alternate Proposal
    In-Reply-To: Alan Bawden <ALAN@AI.AI.MIT.EDU>'s message of Wed, 23 Jul
		 86 01:20:16 EDT
    Message-ID: <860723-004518-1243@Xerox>
    
    ...
    One source of problems with "special" declarations is that they talk
    about two different things: references & bindings. Since we're
    considering radical changes, lets consider separating out the two uses:
    
    Masinter's alternative:
    
    (DECLARE (SPECIAL var1 var2 ...))
    
    only affect the *binding* of var1 and var2. Which binding? Only the one
    that they are lexically apparent in. SPECIAL declarations can only occur
    in declarations in LAMBDA and LET and are only meaningful for the
    variables that are actually bound there. 
    
    How do you tell if a *reference* is special or lexical? A reference is
    lexical if the variable is lexically apparent, and special if it isn't.
    
    If you want, we can add another declaration (SPECIAL-REFERENCE var1 var2
    ...) which is like (IGNORE var1 ...) in that its only use is to turn off
    compiler warnings. In this case, if you declare something as
    USED-FREELY, the compiler won't warn about special references to
    variables that aren't PROCLAIMed special.
    
    (Interlisp has this separation: special declarations are done with
    SPECVARS, while reference declarations, just there to turn off warnings,
    are done with USEDFREE.)

I contend (as I did in my proposal) that not just SPECIAL, but ALL
decl-specs (exluding optimize and declaration) "talk about two
different things: references & bindings."  Do you want to double the
number of decl-specs, one for bindings and one for references?  I
don't.

Under my proposal, it is obvious from context whether a declaration is
talking about a binding or just about references:  If a declaration
about NAME appears in the body of a form that is binding NAME, then
the declaration is talking about the binding, otherwise it is talking
about references.  Simple.

-- Nick