I sent the following article to c.l.l in reference to

  <http://groups.google.com/groups?threadm=3243682048034314%40naggum.no>

but nobody replied. Maybe someone here has the specific answer for
CMUCL at least?

Thanks,
Edi.

*******************************************

Erik Naggum <[EMAIL PROTECTED]> writes:

>   I expect to be able to change a macro definition and its
>   interpreted users will reflect the chang while its compiled users
>   would not.
> 
> (defmacro macro-expansion-test ()
>   (print "I'm being expanded!")
>   `(print "I'm the expansion!"))
> 
> (defun expanded-when ()
>   (macro-expansion-test))
> 
>   Evaluate these and see what `(expanded-when)� produces when you
>   evaluate it twice in a row.  If you get the first `print� while
>   defining it, your environment is very eager.  If you get the first
>   `print� only once, it does the expansion on the first evaluation.
>   I expect it on both.  Then `(compile 'expanded-when)� and it
>   should print "I'm being expanded!" and calling it should only
>   produce "I'm the expansion".

Sorry for being a little bit late on this topic but I just got bitten
by this in my project so here's my question:

I ran Erik Naggum's test with the following CL implementations that I
happen to have currently installed on my laptop:

  - Allegro CL 6.2 trial edition
  - LispWorks professional 4.2.7
  - CMUCL 18d+ (built 2002-09-13)
  - SBCL 0.7.6
  - SCL 1.1.1 trial edition
  - CLISP 2.29

It turns out that (with the notable exception of ACL as was already
mentioned by Erik Naggum) none of them "passes" the test,
i.e. interpreted users of a macro won't reflect the change of the
macro they're using. (SBCL will print "I'm being expanded" only when
EXPANDED-WHEN is defined, CMUCL, CLISP, and LW will print it when it
is defined and when it is compiled, SCL prints it when the function is
called for the first time and when it is compiled.)

Now, if I remember correctly, part of this thread was a discussing
about the fact that SBCL has changed CMUCL's behaviour with respect to
this. While I see that CMUCL and SBCL do behave differently they seem
to be essentially the same as far as reflecting macro changes is
concerned. Someone mentioned that some implementations might have a
switch to control this (whether macros will always be expanded or
not). Is this true? I searched the docs of CMUCL and LW 'cause I'm
working with these most of them time but I couldn't find anything.

Thanks in advance,
Edi.

Reply via email to