Better eval-when-compile example in manual
* doc/lispref/compile.texi (Eval During Compile): `regexp-opt` makes for a poor example because as a pure function it doesn't need `eval-when-compile` for constant inputs.
This commit is contained in:
parent
2c8e7ebe69
commit
88ebabe23a
1 changed files with 2 additions and 2 deletions
|
@ -334,8 +334,8 @@ If you have a constant that needs some calculation to produce,
|
|||
@code{eval-when-compile} can do that at compile-time. For example,
|
||||
|
||||
@lisp
|
||||
(defvar my-regexp
|
||||
(eval-when-compile (regexp-opt '("aaa" "aba" "abb"))))
|
||||
(defvar gauss-schoolboy-problem
|
||||
(eval-when-compile (apply #'+ (number-sequence 1 100))))
|
||||
@end lisp
|
||||
|
||||
@cindex macros, at compile time
|
||||
|
|
Loading…
Add table
Reference in a new issue