Chapter 8
Macros

Macros give Clojure great power. With most programming techniques, you build features within the language. When you write macros, it’s more accurate to say that you’re “adding features to” the language. This is a powerful capability, so you should follow the rules in this chapter until you have enough experience to decide for yourself when to deviate. We’ll explore an example of how to use macros to add a new feature to Clojure.

While powerful, macros are not always simple. Clojure works to make macros as simple as is feasible by including conveniences to solve many common problems that occur when writing macros. We’ll explain these problems and show how Clojure mitigates them.

Macros are so different from other programming idioms that you may struggle to know when to use them. There’s no better guide than the shared experience of the community, so we’ll close the chapter by introducing a taxonomy of Clojure macros, based on the macros in Clojure and contrib libraries.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.223.168