bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#42691: 28.0.50; eval-and-compile


From: Andreas Schwab
Subject: bug#42691: 28.0.50; eval-and-compile
Date: Mon, 03 Aug 2020 11:29:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

On Aug 03 2020, Helmut Eller wrote:

> Compiling this example:
>
>   (require 'cl-lib)
>   (cl-macrolet ((foo () '123))
>     (eval-and-compile (foo)))
>
> with
>
>   emacs -Q --batch -f batch-byte-compile bug.el
>
> prints:
>
>   In toplevel form:
>   bug.el:2:1: Error: Symbol’s function definition is void: foo
>
> I think when compiling eval-and-compile the macro-environment is not
> passed along properly.

Only the body of eval-and-compile is evaluated at that point.  If you
want to modify the environment of the evaluation, you need to move that
modification inside the eval-and-compile form.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."





reply via email to

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