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.
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.)
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.
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).
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