[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
EVAL-WHEN buried inside forms.
- To: "BACH::GREEK" <greek%bach.decnet@HUDSON.DEC.COM>
- Subject: EVAL-WHEN buried inside forms.
- From: Rob MacLachlan <RAM@>
- Date: Wed, 09 Apr 1986 06:25:00 -0000
- Cc: common-lisp <common-lisp@SU-AI.ARPA>
- In-reply-to: Msg of 8 Apr 1986 12:43-EST from BACH::GREEK <greek%bach.decnet at hudson.dec.com>
I agree that CLTL doesn't adequately specify the semantics of
non-top-level EVAL-WHEN's. This isn't surprising, since there
evidently wasn't any attempt to. Multiple compile-time evaluation is
a common characteristic of incorrect eval-when implementations, even
when they don't attempt to handle non-top-level occurrences.
In the Spice Lisp compiler, the Stuff in your example is only
evaluated once. When the compiler initially evaluates the outer
EVAL-WHEN, it binds a special indicating that the code within it has
already been evaluated. The compiler doesn't evaluate non-top-level
EVAL-WHEN's when this flag is true. The flag gets bound to NIL when
the compiler encounters a form which isn't wasn't evaled, such as an
EVAL-WHEN LOAD.
The compiler also needs to communicate with the interpreter so that
when the compiler evals a form, the interpreter evaluates EVAL-WHEN
COMPILE's which it would otherwise ignore.
Rob