concept macro in category clojure

This is an excerpt from Manning's book Clojure: The Essential Reference.
If you are just starting with Clojure, this book covers some theory and background to get you comfortable understanding the main goal of a function, but it shouldn’t be your only text. If you already own or plan to buy a more introductory text, we think this book is a perfect complementary choice: feel free to dig deeper in this book to find more exhaustive information about a function or a macro.
Although macros are nowadays a fundamental and iconic feature of all LISPs, macros did not exist in McCarthy’s original LISP paper, in fact they only started appearing in LISP implementations more than half a decade after the first LISP implementation [88].

This is an excerpt from Manning's book Clojure in Action, Second Edition.
All of the code so far has shown examples of the first purpose—to call functions. Inside a set of parentheses, the first language form is always a function, macro, or special form, and all subsequent forms are its arguments. Figure 1.3 is a simple example of this use of parentheses. We’ll cover what macros and special forms are as we encounter them, but for now you can think of them as functions that get special treatment.
Notice that defn is described as a macro. There’s a whole chapter on macros coming up (chapter 7), but it’s worth mentioning that the defn form expands to a def. For example, the definition of the previous total-cost function is expanded to this:
Figure 9.1. Calling def-modus-operandi creates a var that will hold information about the modus operandi that can later be used to introspect it. The macro itself makes as many calls to defmulti as needed. The detail-modus-operandi macro is the other side of the modus operandi concept: it fills out the implementation details by expanding to as many defmethod calls as specified. It also updates the modus-operandi var to reflect the implementor information.
![]()

This is an excerpt from Manning's book The Joy of Clojure, Second Edition.
When a list is evaluated, the first item of the list—yankee in this case—is resolved to a function, macro, or special operator. If yankee is a function, the remaining items in the list are evaluated in order, and the results are passed to yankee as its parameters.
Using macros to manage resources
Because the arguments to defmacro aren’t evaluated before being passed to the macro, they can be viewed as pure data structures and manipulated and analyzed as such. Because of this, amazing things can be done on the raw forms supplied to macros even in the absence of unquoting.
Imagine a macro named do-until that executes all of its clauses evaluating as true until it gets one that is falsey:
(do-until (even? 2) (println "Even") (odd? 3) (println "Odd") (zero? 1) (println "You never see me") :lollipop (println "Truthy thing")) ; Even ; Odd ;=> nilA good example of this type of macro is Clojure’s core macro cond, which with some minor modifications can be made to behave differently:
One way to design macros is to start by writing out example code that you wish worked—code that has the minimal distance between what you must specify and the specific application domain in which you’re working. Then, with the goal of making this code work, you begin writing macros and functions to fill in the missing pieces.