Macro expansion can have counterintuitive consequences. This section describes some important consequences that can lead to trouble, and rules to follow to avoid trouble.
• Wrong Time: | Do the work in the expansion, not in the macro. | |
• Argument Evaluation: | The expansion should evaluate each macro arg once. | |
• Surprising Local Vars: | Local variable bindings in the expansion require special care. | |
• Eval During Expansion: | Don’t evaluate them; put them in the expansion. | |
• Repeated Expansion: | Avoid depending on how many times expansion is done. |
Copyright © 1990-1996, 1998-2019 Free Software Foundation, Inc.
Licensed under the GNU GPL license.
https://www.gnu.org/software/emacs/manual/html_node/elisp/Problems-with-Macros.html