[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

13.6 Common Problems Using Macros

The basic facts of macro expansion have counterintuitive consequences. This section describes some important consequences that can lead to trouble, and rules to follow to avoid trouble.

13.6.1 Wrong Time  Do the work in the expansion, not in the macro.
13.6.2 Evaluating Macro Arguments Repeatedly  The expansion should evaluate each macro arg once.
13.6.3 Local Variables in Macro Expansions  Local variable bindings in the expansion require special care.
13.6.4 Evaluating Macro Arguments in Expansion  Don't evaluate them; put them in the expansion.
13.6.5 How Many Times is the Macro Expanded?  Avoid depending on how many times expansion is done.



This document was generated on May 2, 2002 using texi2html