Scheme macros introduce two, essentially orthogonal, concepts: hygiene and pattern matching. Hygiene is less important in a lisp2 like Common Lisp. The pattern matching language captures many of the common macro idioms, but has the problem that it is essentially a different language from scheme.
Probably the best introduction to scheme's macros, along with some of the rationale behind them is Shriram Krishnamurthi's PLAI chapters 36 and 37 I suspect that the reason people write scheme style macro systems in common lisp is more for the pattern matching than for the hygiene.
Scheme macros introduce two, essentially orthogonal, concepts: hygiene and pattern matching. Hygiene is less important in a lisp2 like Common Lisp. The pattern matching language captures many of the common macro idioms, but has the problem that it is essentially a different language from scheme.
Probably the best introduction to scheme's macros, along with some of the rationale behind them is Shriram Krishnamurthi's PLAI chapters 36 and 37. I suspect that the reason people write scheme style macro systems in common lisp is more for the pattern matching than for the hygiene.
Because they use a different, non-Scheme language, Scheme macros are less powerful than Common Lisp macros in the almost-formal sense: you can do arbitrary compile-time computation with them, but it's hairy and convoluted. It's a lot like the argument for not using set! : less-powerful set!
Free languages produces less buggy code in exchange for awkward handling of state. Any time you trade power for discipline, you are betting that you will be able to build more complex systems in the long run. That's the best argument I've seen for Scheme macros over Common Lisp ones: if you are building a complex language on top of Scheme, you are less likely to introduce subtle macro bugs if you stick with the standard macro system.
Personally, I don't build big languages using macros, so I prefer Common Lisp macros. I find them much easier for small jobs and avoiding variable capture etc isn't a big deal on a small scale.
4 "Scheme macros" are not less powerful than CL macros -- it's only the pattern-matching-restricted syntax-rules that are less powerful. Arbitrary syntax-case style macros are as powerful as CL macros, and in fact more powerful since CL macros almost ignore lexical information. – Eli Barzilay Aug 15 '10 at 8:43 @Eli Barzilay: several CL implementations provide the lexical information using the interface to 'environments' described in CLtL2.
– Rainer Joswig Aug 15 '10 at 9:37 1 Note that I said almost-formal. I'm pretty sure that Oleg has shown that even syntax-rules is Turing-complete. In my opinion, the restrictions on syntax-rules and syntax-case, even though syntax-case has simpler ways around them, are in place to prevent subtle bugs in complex macros (and to make publishable papers of course).
But I also think those restrictions make simple macros a lot less convenient than with the CL macro system. – Nathan Sanders Aug 15 '10 at 22:53 Rainer: I know -- hence the "almost" in my comment. I generally find that much less capable than what you get with syntax-case macros.
– Eli Barzilay Aug 15 '10 at 23:28 1 Nathan: Yes, your argument is almost formal for syntax-rules, and I'd even say that if you're talking about practical uses of macros, then the argument is stronger. But Scheme does have syntax-case, which can perform arbitrary computations -- no need for those convoluted hacks. – Eli Barzilay Aug 15 '10 at 23:31.
Scheme macros preserve referential transparency. Quoting the "Guile Reference Manual" 6.10.2.2 Hygiene: syntax-rules macros (..) preserve referential transparency. When you read a macro definition, any free bindings in that macro are resolved relative to the macro definition; and when you read a macro instantiation, all free bindings in that expression are resolved relative to the expression.
This property is sometimes known as hygiene, and it does aid in code cleanliness. In your macro definitions, you can feel free to introduce temporary variables, without worrying about inadvertently introducing bindings into the macro expansion. Standard scheme offers syntax-rules and syntax-case.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.