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


Following proposal for a new (macro) function deserves wide circulation
since it may need to establish a successor to the time-honored GENSYM
    Date: 31 August 1981 20:23-EDT
    From: Richard L. Bryan <RLB at MIT-MC>
    Why not introduce a FUNCTION called GENLOCAL which takes one &optional
    arg like GENTEMP and also does the putprop that SI:GEN-LOCAL-VAR does?
    . . . 

For the benefit of the LISP-FORUM subscribers who haven't yet become
familiar with what we've been calling the GENTEMP problem, the
following two paragraphs are lifted from some previous mail:
       Many system facilities automatically generate local variables,
    sometimes even with numeric declarations.  If your code-writer
    (human possibly, but much more likely some automated system) happens 
    to chose a symbol of the same pname, you will quite likely come into 
    conflict with the scope of the declaration.  This applies to any 
    numeric declaration, whether local or global, and to the global 
    (SPECIALS T) declaration.  This problem was accurately diagnosed only 
    relatively recently by RLB, RWK and myself [JonL].
       The particular tactic taken in GENTEMP is to ensure a variable that
    isn't on the obarray.  Another approach has been considered, that of 
    providing truly unique names, perhaps incorporating some stamp of 
    date-time-location long enough to insure that no two distinct calls 
    to the future GENSYM could ever generate the same pname.  Currently, 
    that might require pnames of 12 or more characters, so this could
    be somewhat of a problem.

Any possibility that LISPM, NIL, SPICE, FRANZ, etc can address this
problem too?

MacLISP questions:

    GENLOCAL sounds as good a name as any -- COMPLR has had its own version  
of this for some time (called LOCAL-VAR on the SOBARRAY).   As I mentioned
some time before, SI:GEN-LOCAL-VAR with () as first arg behaves just as
you describe GENLOCAL;  SI:GEN-LOCAL-VAR has been on the SI package until
now because of its admittedly experimental and specialized nature.  
   Since none of these GENTEMP things have been yet advertised, the question 
arises of where to put GENLOCAL -- how about UMLMAC or MLMAC?  
    Another problem is arising now too, namely that there isn't enough space 
in the initial LISP to have any more initial autoloadable facilites.  Possibly
some of the lesser-used symbols could be flushed in favor of the newer -- such 
as DEFSTRUCT (and it's two or three auxillaries), GENTEMP, GENLOCAL, etc.