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

Another omission: global lexicals

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.  References to global lexical variables and constants may use
this cell directly.  In a shallow-binding Lisp, a special binding
shallow-binds this cell, and a special reference reads this cell.
In a deep-binding Lisp, some search needs to be done for a special
reference or store.

    You are right.  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.

    If even this slight possibility scares you, then you could say
that a special binding always binds the global value cell for the symbol.