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


I think there's still a serious flaw with EVAL-WHEN-NON-TOP-LEVEL.  I
had sent mail about this before, but I don't think it received enough

The problem concerns the order of evaluation of forms that are inside an
(EVAL-WHEN (COMPILE ...) ...) with respect to each other and their effects
on other code to be "processed".

Let's assume DEFMACRO expands into something that includes an EVAL-WHEN
(COMPILE) that tells the compiler that the macro is a macro and what it
should expand into.

  (LET ...
    (DEFMACRO M ...)
    (M ...))

But this code should be exactly equivalent to:

  (LET ...
    (FLET ((REST-OF-BODY () (M ...)))
      (DEFMACRO M ...)

Yet the latter code won't have M be treated as a macro in the definition
of REST-OF-BODY.  Since this transformation is fairly fundamental, it seems
to me we can't make the former piece of code allow the DEFMACRO to define
M for use in the rest of the body.

One can make these examples more complicated, of course.  I think the best
solution would be to make the time and ordering of evaluations of forms
inside EVAL-WHEN COMPILE's to be indeterminate, although all must precede
processing of the next top-level form.