What is the best route for an experienced imperative style programmer only familiar with C macros to learn the Racket macro system. Not just the mechanics of it (the how?) but also the where and why to use it and examples that illustrate this.
Should one learn Scheme (or Lisp) macros first? I've heard that the book "On Lisp" has a good explanation of Lisp macros with excellent examples of their use. Would this be useful or not?
I believe that the best tutorial on macros is still Kent Dybvig's "Writing Hygenic macros in Scheme with syntax-case
". It's not specifically about Racket, but basically everything will carry over, and reading the guide that Chris mentioned above will cover any remaining differences. Despite the name, it covers both "hygenic" and "unhygenic" macros.
Edit July 2014:
Since I wrote the above, Greg Hendershott has written a fabulous tutorial on macros in Racket, entitled Fear of Macros. That's now the best place to start learning about Racket macros.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With