[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issue: EVAL-WHEN-NON-TOP-LEVEL



There really isn't enough consideration of what happens when the
EVAL-WHEN isn't a top-level, and what following expressions may
depend on from what was inside a non-top-level EVAL-WHEN.

The problem is what order expressions may get "processed", particularly
by code-walkers such as compilers.

Here's a simple example which assumes the DEFMACRO expands into an
(EVAL-WHEN ...) to tell everyone who cares (particularly the compiler at
compile time) that M is a macro.

  (let ...
    (defmacro m ...)
    (m ...))

But the body of the LET is equivalent to

  (let ...
    (flet ((rest () (m ...)))
      (defmacro m ...)
      (rest)))

which isn't going to work.

The easiest solution is to assume that one cannot depend on the effects
of the EVAL-WHEN at compile time until the next top-level form.

			---Walter
------