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

Common Lisp should use lexical scoping

The subject of this conversation is rather a misnomer.  I believe that
what you are really suggesting is that packages should affect the
mapping from symbols to named entities (variables, functions, etc.)
rather than the mapping from print-names to symbols.

That is certainly a reasonable position to take, and some other
languages (Scheme, T, Lisp 2) have taken it with varying degrees of
success.  As I recall, we considered this when designing Common Lisp but
decided that the technical risk was too high.  One thing to think about
is that there are many different mappings from symbols to named
entities, some of them implemented by user programs; the "et cetera" in
my first paragraph is hiding a multitude of things.  Sticking to Common
Lisp, there are data types, defstructs, declarations, properties, and
keywords.  Going outside of Common Lisp brings in such named objects as
flavors, messages, editor commands, and any number of user-defined
spaces of named objects.  Which of these should be affected by packages
and which should not?  And should the implementation of a mapping by the
property list or by some other mechanism be exposed in the semantics of
that mapping with respect to packages?

T has some reasonable responses to these issues, and I think if Common
Lisp were being designed in 1987 we might decide differently after
studying languages such as T and how their users use them.  But Common
Lisp was designed in 1982.  We decided to go with the well-understood
package philosophy that the Lisp machine had been using since about
1978, substantially redesigned to fix its well-understood bugs without
radically changing the whole philosophy.  It's hard to achieve
perfection in this mortal vale.  For additional insight, see the James
Madison quotation on the second page of the manual.