[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Another omission: global lexicals
- To: Jonathan A Rees <JAR@MIT-MC.ARPA>
- Subject: Another omission: global lexicals
- From: Rob MacLachlan <RAM@C.CS.CMU.EDU>
- Date: Mon, 16 Dec 1985 04:26:00 -0000
- Cc: common-lisp@SU-AI.ARPA
- In-reply-to: Msg of 15 Dec 1985 21:58-EST from Jonathan A Rees <JAR at MIT-MC.ARPA>
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.