Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to learn Racket Macro system for imperative style programmers

Tags:

racket

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?

like image 973
Harry Spier Avatar asked Nov 03 '11 13:11

Harry Spier


1 Answers

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.

like image 174
Sam Tobin-Hochstadt Avatar answered Oct 06 '22 17:10

Sam Tobin-Hochstadt