Skip to Main Content
Programming Clojure, 3rd Edition
book

Programming Clojure, 3rd Edition

by Alex Miller, Stuart Halloway, Aaron Bedra
February 2018
Intermediate to advanced content levelIntermediate to advanced
304 pages
7h 11m
English
Pragmatic Bookshelf
Content preview from Programming Clojure, 3rd Edition

Taxonomy of Macros

Now that you’ve written several macros, we can restate the rules of Macro Club with more supporting detail.

The first rule of Macro Club is, Don’t Write Macros. Macros are complex. If you can avoid that complexity, you should.

The second rule of Macro Club is, Write Macros If That Is the Only Way to Encapsulate a Pattern. As you’ve seen, the patterns that resist encapsulation tend to arise around special forms, which are irregularities in a language. So the second rule can also be called the Special Form Rule.

Special forms have special powers that you, the programmer, do not have:

  • Special forms provide the most basic flow control structures, such as if and recur. All flow control macros must eventually call a special ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming Kotlin

Programming Kotlin

Venkat Subramaniam
Getting Clojure

Getting Clojure

Russ Olsen

Publisher Resources

ISBN: 9781680505719Errata Page