[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
6.10 Macros
At its best, programming in Lisp is an iterative process of building up a language appropriate to the problem at hand, and then solving the problem in that language. Defining new procedures is part of that, but Lisp also allows the user to extend its syntax, with its famous macros.
Macros are syntactic extensions which cause the expression that they appear in to be transformed in some way before being evaluated. In expressions that are intended for macro transformation, the identifier that names the relevant macro must appear as the first element, like this:
(macro-name macro-args …)
Macro expansion is a separate phase of evaluation, run before code is interpreted or compiled. A macro is a program that runs on programs, translating an embedded language into core Scheme(10).
6.10.1 Defining Macros | Binding macros, globally and locally. | |
6.10.2 Syntax-rules Macros | Pattern-driven macros. | |
6.10.3 Support for the syntax-case System | Procedural, hygienic macros. | |
6.10.4 Syntax Transformer Helpers | Helpers for use in procedural macros. | |
6.10.5 Lisp-style Macro Definitions | Lisp-style macros. | |
6.10.6 Identifier Macros | Identifier macros. | |
6.10.7 Syntax Parameters | ||
6.10.8 Eval-when | Affecting the expand-time environment. | |
6.10.9 Internal Macros | Macros as first-class values. |
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on April 20, 2013 using texi2html 5.0.