[plt-scheme] A question on "expand"
The latest version of DrScheme gives you much better feedback about
syntax objects. In the REPL, they have a little turn down knobby that,
when turned, shows you all kinds of information about them.
If you can't get to the CVS archive, you might instead use
syntax-object->datum -- it produces an sexp version of the syntax
object.
One comment about your code: you need to quote the argument to expand
-- it is a function from syntax (or sexp) to syntax.
Robby
At Tue, 12 Nov 2002 16:18:53 +1100, Chris Wright wrote:
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> I'm currently in the middle of getting macros all wrong;)
> So, I'm trying to "see what they look like" by using "expand"
>
> (define-macro t
> (lambda (args)
> `(apply + ,args)))
>
>
> (useless --- I know)
>
> > (t ' (1 2))
> 3
>
> (Yipee!)
>
> but I want to see the expansion:
>
> > (expand (t '(1 2)))
> #<syntax>
> (expand-to-top-form (t '(1 2)))
> #<syntax>
>
> Terrific :(
>
> How do I "see" the expansion?
>
>
> thanks
>
>
> Chris
>
> Dr Chris Wright
> Medical Director, ICU
> Monash Medical Centre
> Clayton VIC 3168