emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 88ebabe23a2: Better eval-when-compile example in manual


From: Mattias Engdegård
Subject: master 88ebabe23a2: Better eval-when-compile example in manual
Date: Thu, 25 Apr 2024 05:39:48 -0400 (EDT)

branch: master
commit 88ebabe23a253ce040de94e6396bc4f587ba6e69
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    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.
---
 doc/lispref/compile.texi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi
index 00602198da5..08e824d2781 100644
--- a/doc/lispref/compile.texi
+++ b/doc/lispref/compile.texi
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]