Macros are used to extend the Lisp language. They consist of a function which instead of returning a computed value, transform their unevaluated arguments into a new form that, when evaluated, produces the actual value of the original form.
For example, the
when macro (see Conditional Structures)
implements a new conditional operation by transforming its arguments
cond statement. That is,
(when condition form …) → (cond (condition form …))
Since macros do not evaluate their arguments, instead just transforming them, they may be expanded at compile-time. The resulting form is then compiled as usual.
Returns true if arg is a macro object.
|• Defining Macros:||Macros are defined like functions|
|• Backquoting:||Creating macros from templates|
|• Macro Expansion:||How macros are used by the evaluator|
|• Compiling Macros:||The compiler expands macros at compile- time.|