[racket] metacircular interpreter: hygiene, lexical variable, and substitution ==> Re: recursive macro expanding order

From: YC (yinso.chen at gmail.com)
Date: Sat Dec 11 17:49:45 EST 2010

On Sat, Dec 11, 2010 at 8:56 AM, Ryan Culpepper <ryanc at ccs.neu.edu> wrote:

> If you are only supporting syntax-rules, then I recommend implementing the
> algorithm from "Macros that Work" by Clinger and Rees. Hygienic macro
> expansion does typically involve alpha-conversion---renaming lexical
> variables to fresh names. The challenge, as you mention above, is in not
> renaming too eagerly.

Thanks Ryan - I will look into the paper.  I am currently only implementing
syntax-rules, as it is non-trivial already, so I need to get that right
first before looking at syntax-case.

> If you're looking for code, SLIB has implementations of several hygienic
> macro expanders, including the one from "Macros that Work". SLIB does not
> run in Racket (mostly because it does not respect Racket's separation of
> phases), but you might be able to extract and port the code you need, or use
> it as inspiration.

Good pointers, thanks.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20101211/63264049/attachment.html>

Posted on the users mailing list.