Clojure / Lisp Macro Training Book

I read Clojure Programming, and I'm interested in a book that discusses how to create macros as wide as possible.

Do you offer a book for this?

Thanks.

+6
lisp clojure jvm-languages
source share
5 answers

The Lisp Macro Quintessential Book is probably Paul Graham on Lisp . However, he used Common Lisp, but that doesn't really matter if you really want to see its macros, although Clojure differs at several levels. (Clojure is Lisp -1, for starters.)

+8
source share

Although both of them target Common Lisp, two great books for this are On Lisp by Paul Graham (the full book is available online at his site ) and Let Over Lambda by Doug Hoyte.

Of the two on, Lisp is the most affordable; even though Clojure IIRC macros are more like hygienic macros, you will almost certainly learn something from it.

+5
source share

The upcoming book by Michael Fogus Joy Clojure , available through the Manning Early Access Program, contains a good chapter on macros. This is a great book explaining the thinking of functional programming, not just how, but why Clojure functions (including the latest 1.2 changes) are implemented as they are.

The chapter on macros describes the following uses of macros in Clojure, how they can be implemented and how they are processed:

definition of governing structures
union of forms
change of forms
returning forms
symbolic control time
manage resources

+4
source share

The book Practical General Lisp explains the Lisp macros very clearly. Clojure macros are similar to Common Lisp macros, which pretty much anything you learn will carry. Let Over Lambda, while fun, interesting, and creative, uses Lisp macros quite differently than most of the serious, experienced, practical Lisp programmers use. I do not recommend using "anamorphic" macros (which "know" about the names of certain variables).

+3
source share

This is not a universal macro writing program, but AMOP shows how to use macros as a 'view' layer for a library / frame.

(Hmm, I don't describe it very well. AMOP is a book that challenges categorization!)

0
source share

All Articles