Bill Clementson's Blog

Bits and pieces (mostly Lisp-related) that I collect from the ether.

November 2003
Sun Mon Tue Wed Thu Fri Sat
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30
Oct  Dec

Where is macroexpand in Scheme?

Thursday, November 6, 2003

I wanted to expand a macro in Scheme today. I had a look for "macroexpand" in R5RS and the PLT documenation. Didn't find it. At least, not in R5RS. In PLT Scheme, the following code seems to be roughly equivalent to macroexpand:

(syntax-object->datum (expand-to-top-form '(some-macro some-params)))
Seems odd that there isn't some more convenient way to do a macro expansion.

Also, I came up with the following questions:

emacs Copyright © 2004 by Bill Clementson