[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Toplevel lexical variables
Ah, but the original desire (as I understand it) was to have the LET
be top-level rather than nested inside of a DEFUN. CLtL allows
top-level forms to be nested inside PROGN but not LET. The use of
top-level LETs is a common, and useful, Scheme idiom. I suspect that
it was discovered by the Scheme folks first because they've had
lexical scoping longer, but we really should support it in Common
Lisp.
Your definition B followed by:
(eval-when (load eval) (b))
does the same job at the costs of: an extra function defintion and
call, and considerably more opaque syntax. I don't believe that it's
any easier to compile properly (i.e. ensure that the internal lambdas
are optionally compiled).
dan