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

Another omission: global lexicals

Now that I'm done editing, let's try again:

    Beautiful: I knew there was a justification for the obvious
implementation.  A special binding is actually a binding of the global
value cell.  Each symbol potentially has one global value cell.  This
value cell is used to store the value of global variables and
constants.  The functions SYMBOL-VALUE, BOUNDP and MAKUNBOUND operate
on this value cell.  In a shallow-binding lisp, all global references
can go directly to this cell.  In a deep-binding lisp, global
references other than special references can go direct; special
references potentially involve a search.

    In fact I think it wouldn't break any Common Lisp programs
(certainly not any tasteful ones) to allow dynamic bindings on any
variable.  It would only make a difference in contorted cases where
there is both a lexical binding and a special binding of the same name
in the same lexical scope.  I doubt this exists outside of the example
in the manual.