Search code examples
macroslispschemesyntax-rulesdefine-syntax

Sources for learning about Scheme Macros: define-syntax and syntax-rules


I've read JRM's Syntax-rules Primer for the Merely Eccentric and it has helped me understand syntax-rules and how it's different from common-lisp's define-macro. syntax-rules is only one way of implementing a syntax transformer within define-syntax.

I'm looking for two things, the first is more examples and explanations of syntax-rules and the second is good sources for learning the other ways of using define-syntax. What resources do you recommend?


Solution

  • To answer your second question: syntax-case is the other form that goes inside define-syntax. Kent Dybvig is the primary proponent of syntax-case, and he has a tutorial on using it [PDF].

    I also read the PLT Scheme documentation on syntax-case for a few more examples, and to learn about the variation in implementation.