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

Another omission: global lexicals

    Date: Sunday, 15 December 1985  16:38-EST
    From: Daniel L. Weinreb <DLW at SCRC-QUABBIN.ARPA>
    To:   RAM, common-lisp at SU-AI.ARPA
    Re:   Another omission: global lexicals

    The oft-discussed

    (let ((a 4))
      (defun foo (x) ...)
      (defun bar (y) ...)

    would be a way to get global lexicals, if it were Common Lisp.  The
    current manual is ambiguous, or at least vague, about whether this is
    construct is part of valid portable Common Lisp or not.

This is clearly legal; any implementation which doesn't allow it is
broken.  There is some confusion about the meaning "top level forms"
such as PROCLAIM within such a construct, but I don't see any other

The lexical scope of a global lexical is everything.  If you insist on
thinking about it this way, a global lexical is a global special which
isn't special, i.e. bindings of that name are lexical instead of
special.  You can also think of a global lexical as being syntactic
sugar for wrapping a let around all the code in the world.

The only issue that seems murky to me is the interaction between
global specials and global lexicals.  What happens if you do a
DEFGLOBAL and then a special procalamation on the same name?  Is a
global lexical BOUNDP?  Can you MAKUNBOUND it?