diff options
| author | Richard M. Stallman | 2007-03-04 17:55:23 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2007-03-04 17:55:23 +0000 |
| commit | 0c47ccd44ef2de6c7df6241b46bb99977251427b (patch) | |
| tree | c48d5c62e9082d58e5d5881e0bf06a8de8f2507e | |
| parent | 107159602ce83adbbe9922003b7aea133f9cb480 (diff) | |
| download | emacs-0c47ccd44ef2de6c7df6241b46bb99977251427b.tar.gz emacs-0c47ccd44ef2de6c7df6241b46bb99977251427b.zip | |
(Eval During Compile): Clarify putting macros in eval-when-compile.
| -rw-r--r-- | lispref/compile.texi | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lispref/compile.texi b/lispref/compile.texi index 0d63887e1cc..4ed0eb8c1bf 100644 --- a/lispref/compile.texi +++ b/lispref/compile.texi | |||
| @@ -454,11 +454,10 @@ used to load it for compiling, but not executing. For example, | |||
| 454 | (require 'my-macro-package)) ;; only macros needed from this | 454 | (require 'my-macro-package)) ;; only macros needed from this |
| 455 | @end lisp | 455 | @end lisp |
| 456 | 456 | ||
| 457 | The same sort of thing goes for macros or @code{defalias}es defined | 457 | The same sort of thing goes for macros and @code{defsubst} functions |
| 458 | locally and only for use within the file. They can be defined while | 458 | defined locally and only for use within the file. They are needed for |
| 459 | compiling, but then not needed when executing. This is good for code | 459 | compiling the file, but in most cases they are not needed for |
| 460 | that's only a fallback for compatibility with other versions of Emacs. | 460 | execution of the compiled file. For example, |
| 461 | For example. | ||
| 462 | 461 | ||
| 463 | @lisp | 462 | @lisp |
| 464 | (eval-when-compile | 463 | (eval-when-compile |
| @@ -467,6 +466,10 @@ For example. | |||
| 467 | (compatibility code)))) | 466 | (compatibility code)))) |
| 468 | @end lisp | 467 | @end lisp |
| 469 | 468 | ||
| 469 | @noindent | ||
| 470 | This is often good for code that's only a fallback for compatibility | ||
| 471 | with other versions of Emacs. | ||
| 472 | |||
| 470 | @strong{Common Lisp Note:} At top level, @code{eval-when-compile} is analogous to the Common | 473 | @strong{Common Lisp Note:} At top level, @code{eval-when-compile} is analogous to the Common |
| 471 | Lisp idiom @code{(eval-when (compile eval) @dots{})}. Elsewhere, the | 474 | Lisp idiom @code{(eval-when (compile eval) @dots{})}. Elsewhere, the |
| 472 | Common Lisp @samp{#.} reader macro (but not when interpreting) is closer | 475 | Common Lisp @samp{#.} reader macro (but not when interpreting) is closer |