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:
Mattias Engdegård 2024-04-25 11:33:25 +02:00
parent 2c8e7ebe69
commit 88ebabe23a

View file

@ -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