Chapter 4. Metaprogramming with Macros
Programmers often stumble into situations where they would like to add features or constructs to their programming language of choice. Generally, if a feature would have to be added to a language, the language's compiler or interpreter would need some modification. Alternatively, Clojure (and other Lisps as well) uses macros to solve this problem. The term metaprogramming is used to describe the ability to generate or manipulate a program's source code by using another program. Macros are a metaprogramming tool that allow programmers to easily add new features to their programming language.
Lisps are not the only languages with support for macro-based metaprogramming. For example, in C and C++, macros are ...
Get Clojure: High Performance JVM Programming 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.