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

From: John Clements (clements at brinckerhoff.org)
Date: Tue Nov 11 16:11:54 EST 2003

On Tuesday, November 11, 2003, at 04:00  PM, Bill Clementson wrote:

> --- John Clements <clements at brinckerhoff.org> wrote:
> [snip]
>> Ha!  Funny, just this morning I was thinking that
>> perhaps 'Check
>> Syntax' should be disabled in the Expander language.
>>  No, you click on
>> Execute.  That is, the Expander language level is
>> one that elaborates
>> the user's code into code that expands and displays
>> itself.
> Neat!
> The expansion seems to do an "expand" rather than an
> "expand-to-top-level". I've found that
> "expand-to-top-level" is more useful to me in
> understanding what the macro is doing, why did you
> choose to use "expand" instead? What type of
> information is shown in "expand" that you feel would
> be useful in understanding a macro expansion? (I just
> want to understand the rationale as I played around
> with both and I couldn't understand the value of the
> output produced by "expand". I saw that it might be
> useful for the DrScheme tool implementer, but I
> couldn't see it's value for the "normal" macro writer.
> For the normal macro writer, I would have thought that
> "expand-to-top-level" was more useful)
> Also, the "General Info" on the right-hand side of the
> expansion always seems to have a colorer.ss structure
> as the source. What is the significance of this?

I can't help you with either of these.  In particular, I'm not sure 
what you mean by 'expand-to-top-level.'  I should clarify that I'm not 
the author of the Check Syntax tool.

> [snip]
>>> Stepper is a neat tool - it's unfortunate that it
>> only
>>> works at the lower language levels. Are you aware
>> of
>>> any programs that are doing interesting things
>> with
>>> syntax objects other than stepper? I would like to
>> see
>>> some good examples of how people are using this
>>> language feature.
>> Very unfortunate, I agree.  Mea Culpa.
> Are you planning to expand (pun intended :) )
> stepper's functionality to include support for the
> more advanced language levels at some stage?

Yes and no.  The stepper should continue to grow.  At the same time, 
the rigorous attention to matching a plausible reduction semantics 
hobbles the progress of the stepper to higher language levels.  The 
debugger tool approaches this from the opposite direction; that is, it 
makes no attempt to unwind macros at all, and just dumps it all on the 

>> Yes, syntax properties are used by a variety of
>> tools.  grep for
>> 'syntax-property' in the collects tree (and prune
>> out the 'doc'
>> collection), and you'll see hits in the compiler,
>> the teachpack code,
>> the Check Syntax tool, the stacktrace/errortrace,
>> the language level
>> implementations, the contract library, and all over
>> the stepper.
> Thanks, I'll have to do some exploring.
> --
> Bill Clementson
> __________________________________
> Do you Yahoo!?
> Protect your identity with Yahoo! Mail AddressGuard
> http://antispam.yahoo.com/whatsnewfree

Posted on the users mailing list.