Mercurial > hg > xemacs-beta
comparison man/lispref/macros.texi @ 444:576fb035e263 r21-2-37
Import from CVS: tag r21-2-37
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:36:19 +0200 |
parents | 3ecd8885ac67 |
children | 6780963faf78 |
comparison
equal
deleted
inserted
replaced
443:a8296e22da4e | 444:576fb035e263 |
---|---|
1 @c -*-texinfo-*- | 1 @c -*-texinfo-*- |
2 @c This is part of the XEmacs Lisp Reference Manual. | 2 @c This is part of the XEmacs Lisp Reference Manual. |
3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. | 3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. |
4 @c See the file lispref.texi for copying conditions. | 4 @c See the file lispref.texi for copying conditions. |
5 @setfilename ../../info/macros.info | 5 @setfilename ../../info/macros.info |
6 @node Macros, Loading, Functions, Top | 6 @node Macros, Loading, Functions, Top |
7 @chapter Macros | 7 @chapter Macros |
8 @cindex macros | 8 @cindex macros |
280 `(use the words ,@@(cdr list) as elements) | 280 `(use the words ,@@(cdr list) as elements) |
281 @result{} (use the words foo bar as elements) | 281 @result{} (use the words foo bar as elements) |
282 @end group | 282 @end group |
283 @end example | 283 @end example |
284 | 284 |
285 @quotation | 285 @quotation |
286 In older versions of Emacs (before XEmacs 19.12 or FSF Emacs version | 286 In older versions of Emacs (before XEmacs 19.12 or FSF Emacs version |
287 19.29), @samp{`} used a different syntax which required an extra level | 287 19.29), @samp{`} used a different syntax which required an extra level |
288 of parentheses around the entire backquote construct. Likewise, each | 288 of parentheses around the entire backquote construct. Likewise, each |
289 @samp{,} or @samp{,@@} substitution required an extra level of | 289 @samp{,} or @samp{,@@} substitution required an extra level of |
290 parentheses surrounding both the @samp{,} or @samp{,@@} and the | 290 parentheses surrounding both the @samp{,} or @samp{,@@} and the |
395 (princ (format "%d %d" i square)) | 395 (princ (format "%d %d" i square)) |
396 (inc i))) | 396 (inc i))) |
397 @end group | 397 @end group |
398 @end smallexample | 398 @end smallexample |
399 | 399 |
400 Here is a macro definition that creates this expansion: | 400 Here is a macro definition that creates this expansion: |
401 | 401 |
402 @smallexample | 402 @smallexample |
403 @group | 403 @group |
404 (defmacro for (var from init to final do &rest body) | 404 (defmacro for (var from init to final do &rest body) |
405 "Execute a simple for loop: (for i from 1 to 10 do (print i))." | 405 "Execute a simple for loop: (for i from 1 to 10 do (print i))." |