[plt-scheme] Where is macroexpand in PLT Scheme?

From: Bill Clementson (bill_clementson at yahoo.com)
Date: Wed Nov 12 16:13:18 EST 2003

--- Joe Marshall <jrm at ccs.neu.edu> wrote:
> Bill Clementson <bill_clementson at yahoo.com> writes:

> > Very interesting comment. Could you elaborate on
> this
> > please - how is expanding an R5RS macro different
> from
> > expanding a CL macro and why is it difficult to
> make
> > it work "correctly" with R5RS macros? 
> The problem is hygiene.  Free variables in the macro
> are supposed to
> be bound to the lexical value apparent *at the
> macro*.
[snip code example]

> > To me, the output from the :top expansion is more
> > readable and understandable. Why do people seem to
> > prefer the output from :expand?
> The :top expansion is more readable, but it is not
> necessarily
> correct.  The :expand expansion is correct, but less
> readable.

This is clearer to me now given John Clements'
explanation and your example above. By using expand,
one can take into account any lexical bindings that
would have an effect on the expansion. This is not
possible with expand-to-top-form. 

Next time, just hit me with a 2X4 :-)

Thank you for your explanations.

Bill Clementson

Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

Posted on the users mailing list.