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

eval-when ambiguity



When compiling a file with a top level call:

(eval-when (load)
  (defun foo ()
         (a-macro))
)

There seem to be 2 possibilites:
1. The definition gets compiled at compile-file time
   and saved to the file in compiled format
2. The list structure of the call is saved to the file
   and it's EVALED when the file is loaded.

Semantically, the major difference seems to be the time
of macroexpansion.
I can imagine wanting both functionalities.
Which one is CL defined to do?
How do you get the other functionality?
[keep in mind that the first arg to the eval-when might have
compile or eval in it.]

In CLtL, p 69, the first 2 paragraphs of the eval-when description
are clear and concise. They indicate CL should perform as in 2 above.
The succeeding paragraphs, in an attempt to clarify, do exactly
the opposite.