[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Closure, Null Lexical Env.
- To: Hvatum@MIT-MULTICS.ARPA
- Subject: Re: Closure, Null Lexical Env.
- From: Miller.pa@Xerox.COM
- Date: Mon, 09 Jun 1986 21:35:00 -0000
- Cc: common-lisp@SU-AI.ARPA
- In-reply-to: Hvatum@MIT-MULTICS.ARPA's message of Mon, 9 Jun 86 00:35 EDT
"(eval '#'(lambda (x y) ...) nil)" does seem to be the best (only?) way
to express "closure over null lexical environment" in common-lisp.
There is no reason for the compiler to not compile this. Both the
arguments to "eval" are constant, and there are no environmental
dependencies. This can be compiled for the same reason that "(+ 3 4)"
can be turned into a "7" at compile time. The constant list "(FUNCTION
(LAMBDA ...))" would not have to be preserved in the compiled code for
the same reason that the "3" doesn't.
I realize that probably no existing compiler compiles this, but it would
seem an easy change to make. As easy as adding some other language
construct to create such closures, but without making the language
definition any bloody larger. Any program which assumed this
enhancement would continue to work on current implementations (although