unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: 57397@debbugs.gnu.org, Lars Ingebrigtsen <larsi@gnus.org>
Subject: bug#57397: cl-letf blindly macroexpands places
Date: Sat, 27 Aug 2022 10:48:17 -0400	[thread overview]
Message-ID: <jwvwnatvjjb.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87leralavg.fsf@web.de> (Michael Heerdegen's message of "Sat, 27 Aug 2022 03:43:15 +0200")

>> > Maybe it's enough to expand only symbol macros?
>> Yes, that should still cover the original need in bug#26073 without
>> breaking your use case.
> Was it necessary to really expand symbol macros to fix that bug, or is
> the purpose only to handle the following `symbolp' test correctly?

No the problem shows up in the `gv-letplace` that follows immediately,
so by the time we get to the `symbolp` test it's too late.
But I suspect that the better fix is to skip the macroexpand call here
and to change `gv-get` so as to do a `macroexpand-1` call even if its
arg is a `symbolp`.

>> But regardless of this, we should probably turn `gv-synthetic-place`
>> into a function so it's more robust.
> Why is it a macro?

Beats me.
I tried to ask the original author but he was not available for comments.

> Seems to work quite as well (using the same body and
> gv-spec) when defined as a function.

The only downside is that the code is less efficient (the getter has to
construct the closure of the setter, then call `gv-synthetic-place`
which then just throws it away) but that should be easy to fix with
a compiler macro.


        Stefan






  reply	other threads:[~2022-08-27 14:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-25  4:42 bug#57397: 29.0.50; cl-letf blindly macroexpands places Michael Heerdegen
2022-08-25 19:33 ` bug#57397: " Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-27  1:43   ` Michael Heerdegen
2022-08-27 14:48     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-08-31  1:32       ` Michael Heerdegen
2022-09-04  2:55         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-28 15:44           ` Michael Heerdegen
2022-09-28 16:29             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-28 16:52               ` Eli Zaretskii
2022-09-28 17:10                 ` Michael Heerdegen
2022-09-28 17:12                   ` Lars Ingebrigtsen
2022-09-28 17:15                   ` Eli Zaretskii
2022-09-28 17:56                     ` Michael Heerdegen
2022-09-28 18:15                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-02 18:18                         ` bug#57397: 29.0.50; " Michael Heerdegen

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=jwvwnatvjjb.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=57397@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=michael_heerdegen@web.de \
    --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).