Chapter 3Use Your Powers Wisely

Now that you have the knowledge you need about how to write macros, it’s time to start building a great sense for when to write them. Believe it or not, macros do have downsides. In fact, there’s a popular saying in the Clojure world that you should never use a macro when a function will do. In this chapter you’ll see some problems that are inherent to macros, a few outright mistakes to avoid, and some design decisions that can make maintenance harder down the road.

Get Mastering Clojure Macros now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.