[plt-scheme] Re: Novice question: evaluating symbols

From: David Brown (plt at davidb.org)
Date: Sat Jan 9 13:05:39 EST 2010

On Sat, Jan 09, 2010 at 09:18:26AM -0500, Matthias Felleisen wrote:

>> My main problem is that `syntax-rules', `syntax-case',
>> `with-syntax' and others that I have not used yet use the syntax in
>> quite different ways, and sometimes you have to #' and sometimes
>> you have to (syntax->datum ....) and sometimes not. I have a hard
>> time to know when to use the right one at the right time (the docs
>> are a bit obscure on these points).  Whereas in `defmacro', I know
>> exactly when to use `quote' and `unquote'.
>Some of it is like saying that "I grew up on C syntax and I really
>know where to put ()s there. With this Scheme syntax, I never know."

As another point.  I have always found defmacro-style macros to be
very difficult to write.  Aside from just the hygene issues, I've
always felt that tracking quotes and such to be complex and difficult
to understand.

On the other hand, I find syntax-rules and syntax-case to be very
clear, and easy to work with.

BTW, the given defmacro isn't hygenic even beyond the generated name.
What if 'define' is rebound around the call site?


Posted on the users mailing list.