Subject: Re: macro/call order [particularly in SBCL]
From: (Rob Warnock)
Date: Fri, 27 Jul 2007 01:39:14 -0500
Newsgroups: comp.lang.lisp
Message-ID: <>
Pascal Costanza  <> 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: Macro Forms

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			<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607