From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 55156@debbugs.gnu.org
Subject: bug#55156: [PATCH] eval.c: New functions `defvar-f` and `defconst-f`
Date: Wed, 27 Apr 2022 21:29:34 -0400 [thread overview]
Message-ID: <jwvilquj8sh.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87pml2p35g.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 28 Apr 2022 00:33:47 +0200")
>> Try:
>>
>> (let ((f (byte-compile
>> '(lambda (x)
>> (defvar sm-x (progn (message "hello %S" x) x))))))
>> (funcall f 5)
>> (funcall f 6))
>>
>> and check *Messages* :-(
>
> Oh, if we call a function containing the defvar... Yes, that's probably
> rare enough that nobody's noticed.
>
> I tried to byte-compile a file and just load the .elc a few times, and
> the message was only done once:
>
> (defvar this-thing (message "hello"))
Duh, I forgot about the toplevel special case, indeed. OK, now it makes sense.
>> If we prefer keeping the behavior we currently promise, we can of course
>> do that (just change `defvar-f` so it takes a function of no argument as
>> second arg, it makes the generated code (and the C code) a bit less
>> simple, but it's no worse than what we currently have).
> I think I'd prefer keeping the behaviour we currently promise,
So do I. I'll see about updating the patch.
Stefan
next prev parent reply other threads:[~2022-04-28 1:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-27 21:46 bug#55156: [PATCH] eval.c: New functions `defvar-f` and `defconst-f` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-27 22:11 ` Lars Ingebrigtsen
2022-04-27 22:29 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-27 22:33 ` Lars Ingebrigtsen
2022-04-28 1:29 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-04-28 5:44 ` Eli Zaretskii
2022-04-29 3:10 ` Richard Stallman
2022-04-28 5:34 ` Eli Zaretskii
2022-04-28 13:26 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-28 13:30 ` Lars Ingebrigtsen
2022-04-28 13:33 ` Lars Ingebrigtsen
2022-04-28 13:45 ` Eli Zaretskii
2022-04-29 3:10 ` Richard Stallman
2022-05-25 20:38 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-26 5:01 ` Eli Zaretskii
2022-05-27 1:27 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-29 3:10 ` Richard Stallman
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=jwvilquj8sh.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=55156@debbugs.gnu.org \
--cc=larsi@gnus.org \
--cc=monnier@iro.umontreal.ca \
/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).