Browse Clojure Foundations for Java Developers

Practical Macro Examples

Recognize the macro patterns you’ll see in real code and learn how to read them.

You already use macros every day in Clojure, even before you write your own. Many of the “core language features” are macros: conditional shapes, threading macros, and binding helpers.

The practical goal in this section is code reading:

  • recognize macro-heavy idioms like ->, ->>, cond->, when, when-let, if-let, doto
  • expand them when you are unsure
  • decide when a custom macro actually improves readability for your team

If you can read macro code confidently, you can work in almost any Clojure codebase without fear.

In this section

Revised on Friday, April 24, 2026