www.delorie.com/gnu/docs/elisp-manual-21/elisp_180.html   search  
 
Buy the book!


GNU Emacs Lisp Reference Manual

[ < ] [ > ]   [ << ] [ 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.


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003