[plt-scheme] On hygiene and trust

From: Grant Rettke (grettke at acm.org)
Date: Tue Jul 7 09:36:49 EDT 2009

Hi folks,

Over the past year or so I've collected fragments from email where
people who might simply be referred to as "macro gods" have shared
with the list that hygiene is essential when you start dealing with
anything more than trivial macros. I believe that the PLT object
system is implemented with macros, and there is probably more too,
right?

I have also studied and practiced writing macros with syntax-rules and
syntax-case. I have learned perhaps enough to know how to use them,
but I have also learned enough to know that I have a long way to go in
terms of being comfortable with manipulating syntax objects. Perhaps
it is just practice, but same difference. Not sure how to say this but
I think I know how good I am and also how bad I am at it! (seriously
:) )

I have also seen posts in comp.lang.scheme and also here demonstrating
situations where defmacro/gensym could not provide the desired
hygiene. I didn't dig in deeper yet, though.

The reason I think about this is that on a mostly Lisper mailing list
someone asked me why hygiene is better, and barring simply hygiene
examples that I can explain, I don't understand the deeper issues. I
couldn't explain it. However, I trust what the experts have said here,
that hygiene is the best. I know that it is not good to trust though,
and it is better to understand.

Is there some key paper or research that covers this topic?

Best wishes,

Grant


Posted on the users mailing list.