The *(term) for a way to extend the _(syntax) and _(semantics) of a _(programming language); they are a special case of compile-time *(rewrite).

Macros operate at the level of a structure in which the language is modeled, which can be at various levels: theoretical monads, abstract syntax trees, lexer tokens, or character strings. The higher-level methods of doing this generally offer cleaner methods of expressing these transformations, and are preferred when accessible.

They are a particular case of _(metaprogramming), done within a language itself, as a restricted form of _(compile-time reflection). The integration of macros with general compile-time reflection requires the availability of suitable ways to control code emission, that are not usually available in standard macro systems; in general these subjects are considered separate, except when _(open implementation)s are explicitly brought up.

<ul class="links">
  <li>_(Growing Languages with Metamorphic Syntax Macros| http://citeseer.nj.nec.com/brabrand00growing.html) describes a syntax macro language with interesting properties and generality.</li>
  <li> _(Some LL1 posts| http://www.ai.mit.edu/~gregs/ll1-discuss-archive-html/msg02079.html) which offer some useful advice about when and how to use macros. Perhaps these will coalesce into a proper set of published principles soon.</li>
  <li>_("Macros as Multi-Stage Computations: Type-Safe, Generative, Binding Macros in MacroML"| http://citeseer.nj.nec.com/440438.html)
  <li>_(Maya| http://www.cs.utah.edu/~jbaker/maya/): a multi-dispatch macro system for _(Java) written in _(Kawa|Scheme).
  <li>_("Semantically-Sensitive Macroprocessing"|http://citeseer.nj.nec.com/maddox89semanticallysensitive.html).</li>
  <li>_("Macro by Example"|http://www.ccs.neu.edu/home/dorai/mbe/mbe-imps.html).</li>
  <li>_(First-class Macros Have Types| http://www.bawden.org/mtt/) by _(Alan Bawden).
</ul>