Unlike many on this site, I'm not a long time lisper, so I'm still trying to develop a feel for what macros are and how they work. Unfortunately, I'm kind of confused about the differences between hygienic and unhygienic macros. I have a number of questions and I hope that those more experienced than me can enlighten me with their responses: 1) As I understand it, unhygienic macros are somewhat dangerous because the don't do any checking for the cases where a special form/macro/function used in the macro-expansion has been shadowed by something weird. For example: > (mac dumb (x) `(* ,x ,x)) #<procedure> > (let * 'foo
(dumb 3)) Error!!! Is this the general idea? Are there any underlying subtleties in this situation? 2) Scheme's macros appear to work differently from arc and CL's macros. Scheme macros use a special pattern language to describe the code transformations. Is the use of this type of pattern language something required to make hygienic macros work or is it just a design choice that the Scheme implementors made? 3) How could a hygienic macro system be implemented on top of Arc? Are there any features of Arc that make such a system currently impossible? |