diff options
Diffstat (limited to 'devdocs/elisp/problems-with-macros.html')
| -rw-r--r-- | devdocs/elisp/problems-with-macros.html | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/devdocs/elisp/problems-with-macros.html b/devdocs/elisp/problems-with-macros.html new file mode 100644 index 00000000..5667b406 --- /dev/null +++ b/devdocs/elisp/problems-with-macros.html @@ -0,0 +1,31 @@ + <h3 class="section">Common Problems Using Macros</h3> <p>Macro expansion can have counterintuitive consequences. This section describes some important consequences that can lead to trouble, and rules to follow to avoid trouble. </p> <table class="menu" border="0" cellspacing="0"> <tr> +<td align="left" valign="top">• <a href="wrong-time" accesskey="1">Wrong Time</a> +</td> +<td> </td> +<td align="left" valign="top">Do the work in the expansion, not in the macro. </td> +</tr> <tr> +<td align="left" valign="top">• <a href="argument-evaluation" accesskey="2">Argument Evaluation</a> +</td> +<td> </td> +<td align="left" valign="top">The expansion should evaluate each macro arg once. </td> +</tr> <tr> +<td align="left" valign="top">• <a href="surprising-local-vars" accesskey="3">Surprising Local Vars</a> +</td> +<td> </td> +<td align="left" valign="top">Local variable bindings in the expansion require special care. </td> +</tr> <tr> +<td align="left" valign="top">• <a href="eval-during-expansion" accesskey="4">Eval During Expansion</a> +</td> +<td> </td> +<td align="left" valign="top">Don’t evaluate them; put them in the expansion. </td> +</tr> <tr> +<td align="left" valign="top">• <a href="repeated-expansion" accesskey="5">Repeated Expansion</a> +</td> +<td> </td> +<td align="left" valign="top">Avoid depending on how many times expansion is done. </td> +</tr> </table><div class="_attribution"> + <p class="_attribution-p"> + Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br> + <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Problems-with-Macros.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Problems-with-Macros.html</a> + </p> +</div> |
