<br><div class="gmail_quote">On Sat, Dec 11, 2010 at 8:56 AM, Ryan Culpepper <span dir="ltr"><<a href="mailto:ryanc@ccs.neu.edu">ryanc@ccs.neu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br></div>
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.<br>
</blockquote><div><br></div><div>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. </div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
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.<br>
</blockquote><div><br></div><div>Good pointers, thanks.</div><div> </div><div><meta charset="utf-8"><div>Cheers,</div><div>yc</div></div><div><br></div></div>