[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Compiling functions which appear inside top-level forms.
- To: Gregor.pa@XEROX.COM
- Subject: Compiling functions which appear inside top-level forms.
- From: "Scott E. Fahlman" <Fahlman@C.CS.CMU.EDU>
- Date: Mon, 10 Feb 1986 19:46:00 -0000
- Cc: Common-Lisp@SU-AI.ARPA
- In-reply-to: Msg of 10 Feb 1986 14:33-EST from Gregor.pa at Xerox.COM
- Sender: FAHLMAN@C.CS.CMU.EDU
Question to implementors:
Will the function #'(lambda (x y)...) be compiled?
In Spice Lisp, yes, this is compiled.
Will it be a lexical closure?
In this example, the question is moot since the function does not use
anything from the lexical envrionment outside of itself. But in
general, it will see the lexical environment.
Would it be reasonable to require that it be compiled?
Yes. There was a lot of discussion before the book came out about the
technique of turning random top-level forms into functions of no args
which the compiler can process normally. It then emits the definition
followed by a call to this odd function. We shouldn't require exactly
that, since some implementations would then have trouble GC-ing this
anonymous function, but we should require equivalent semantics in
judging what the compiler compiles. I don't think this is required
currently -- as you say, the description of Compile-File needs a lot of