[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Basic Design Questions
- To: firstname.lastname@example.org (Stanley Shebs)
- Subject: Basic Design Questions
- From: Rob MacLachlan <RAM@C.CS.CMU.EDU>
- Date: Mon, 17 Feb 1986 17:09:00 -0000
- Cc: common-lisp@SU-AI.ARPA
- In-reply-to: Msg of 17 Feb 1986 11:13-EST from shebs%utah-orion at utah-cs.arpa (Stanley Shebs)
If you have a lexical Lisp without closures, how do you deal with
upward funargs? Dump core? Pascal gets away without closures by not
having first-class functional values; this doesn't seem to work very
well in Lisp. Alternatively, the compiler could signal an error
whenever it couldn't prove you weren't creating a closure. That would
be even sillier, since the compiler would be doing all the work of
implementing closures without getting any of the benefit. You
certainly wouldn't want warts like these in an "educational subset."
An interesting point in favor of the function/variable split is
that it makes macros work better. Most bindings in programs are
variable bindings, while most global references are function
references. If the program binds something that the macroexpansion
references then the macro won't work. This is because macros aren't
If the bindings that a program makes don't intersect with the
functions that the macroexpansion is trying to reference, then the
macro works. If the set of global references is mostly disjoint from
the set of local bindings, then more macros will work the first time.
Separating the functional and normal values tends to have this effect.
Yes this is an ad-hoc kludge, but that's what Lisp is all about. Lisp
is getting things done that we don't yet know how to do right.