Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Book for learning how to write Clojure/Lisp Macros [closed]

I'm reading "Programming Clojure" and I'm interested in a book that discusses how to create macros as extensive as possible.

Do you suggest a book for this?

Thanks.

like image 612
Chiron Avatar asked Aug 26 '10 01:08

Chiron


3 Answers

The quintessential book on Lisp macros is probably Paul Graham's On Lisp. It used Common Lisp, though, but that doesn't matter too much if what you really want to look at it macros, although Clojure's are different on a number of levels. (Clojure being a Lisp-1, to begin with.)

like image 86
Isaac Avatar answered Nov 03 '22 16:11

Isaac


Although they're both aimed at Common Lisp, two great books for this are On Lisp by Paul Graham (full book available free online at his website) and Let Over Lambda by Doug Hoyte.

Of the two On Lisp is more accessible; even though Clojure macros are IIRC more similar to Scheme's hygienic macros, you'll still almost certainly learn something from it.

like image 5
Derrick Turk Avatar answered Nov 03 '22 16:11

Derrick Turk


The book "Practical Common Lisp" explains Lisp macros very clearly. Clojure's macros are similar enough to those of Common Lisp that pretty much all of what you'd learn would carry over. "Let Over Lambda", while a fun, interesting, and creative work, uses Lisp macros very differently from the way they're used by most serious, experienced, practical Lisp programmers. I don't recommend the use of "anamorphic" macros (that "know" about specific variable names).

like image 4
Dan Weinreb Avatar answered Nov 03 '22 15:11

Dan Weinreb