Pascal Costanza <firstname.lastname@example.org> wrote:
| ANSI Common Lisp doesn't pose such requirements on interpreted code. An
| implementation is allowed to expand macros lazily on each invocation,
| and it is even allowed to reexpand them over and over again. This is
| actually quite useful during development, because you can immediately
| see changes in macro definitions without recompilation.
Actually, unless an "interpreter" *does* some sort of preprocessing
to expand macros [whether or not that's 100% equivalent to ANSI CL's
"minimal compilation"] once & only once, then it is *required* to
reexpand them over and over again... since "displacing" expansion
[a.k.a. self-modifying code a.k.a. overwriting the macro call with
its expansion] is expressly forbidden, see:
188.8.131.52.2.2 Macro Forms
Issue SELF-MODIFYING-CODE Writeup
Many implementations (CMUCL, CLISP, most others) get around that for
performance reasons by actually doing at least Minimal Compilation
of even "interpreted" code [REPL & LOADed source], so even there
changing the function behind a macro will require re-evaluating any
defining forms [DEFUN, DEFVAR, etc.] whose values contained a call
of that macro.
| My guess is that you haven't noticed a difference between CLISP and
| SBCL, but rather a difference between an interpreter and a compiler.
No, the CLISP interpreter preprocesses at least the macros, too.
Rob Warnock <email@example.com>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607