From: Helmut Eller <eller.helmut@gmail.com>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: 42691@debbugs.gnu.org
Subject: bug#42691: 28.0.50; eval-and-compile
Date: Mon, 03 Aug 2020 12:27:15 +0200 [thread overview]
Message-ID: <m2sgd4kosc.fsf@gmail.com> (raw)
In-Reply-To: <87bljsqdqq.fsf@igel.home> (Andreas Schwab's message of "Mon, 03 Aug 2020 11:29:17 +0200")
On Mon, Aug 03 2020, Andreas Schwab wrote:
> 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.
Are you saying this is not a bug in eval-and-compile?
The docstring of eval-and-compile says eval-and-compile is like progn,
except that the body it is evaluated at compile-time too. If it is
supposed to work like progn, then the environment should be defined as
for progn.
Helmut
next prev parent reply other threads:[~2020-08-03 10:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-03 7:57 bug#42691: 28.0.50; eval-and-compile Helmut Eller
2020-08-03 9:29 ` Andreas Schwab
2020-08-03 10:27 ` Helmut Eller [this message]
2020-08-03 12:04 ` Andreas Schwab
2020-08-03 12:55 ` Helmut Eller
2020-08-03 13:16 ` Andreas Schwab
2021-09-16 15:01 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2sgd4kosc.fsf@gmail.com \
--to=eller.helmut@gmail.com \
--cc=42691@debbugs.gnu.org \
--cc=schwab@linux-m68k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).