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

The list of resources at The Scheme Cookbook is a great place to start. If you prefer papers, then don't hessitate to visit readscheme.org.


The JRM Syntax-rules primer is quite good, but Chapter 36 of Programming Languages: Application and Interpretation, by Shriram Krishnamurti http://www.cs.brown.edu/~sk/Publications/Books/ProgLangs/) also has good coverage of writing Scheme macros. That material has been used and improved over several short articles, tech reports, etc, over the past 10 years, so it's not a 'this was true about the X implementation of Scheme in 1983 that is no longer accessible' paper.


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.