unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Thuna <thuna.cing@gmail.com>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: 72328@debbugs.gnu.org
Subject: bug#72328: [PATCH] Nested backquote in pcase
Date: Mon, 29 Jul 2024 22:59:03 +0200	[thread overview]
Message-ID: <87le1j29uw.fsf@gmail.com> (raw)
In-Reply-To: <87y15kq65n.fsf@web.de>


>> I feel like there is a possible misunderstanding.  I am not preventing a
>> backquote pattern from going deeper into a list.  Your example would
>> remain perfectly consistent under the new behavior.  What *wouldn't*,
>> however, is something like
>>
>> (let ((a 1) (b 2))
>>  (pcase `(69 foo `(,bar ,,a ((,,b))))
>>    (`(69 foo `(,bar ,,a ((,,b))))
>>     (list a b))))
>
> Ok - so backquote the macro handles nested invocations of backquote
> specially (the nested calls are not expanded individually, only the
> outermost backquote expression gets expanded), while the pcase' backquote
> implementation is backquote agnostic, it currently treats it like any
> random symbol.  Your patch tries to adapt pcase backquote to the
> backquote macro semantics.  Correct?

Yes, that is precisely the case.  I'm afraid I wasn't able to explain it
well enough.

> If there aren't any downsides then this makes a lot of sense and would
> be a good thing to do indeed.

The one downside that I can see is the situation I mentioned in my
previous message where you explicitly *want* to bypass all backquotes,
plus the fact that this is backwards incompatible, even though to be
effected you would need to be making use of the fact that comma behaves
this way - which I still don't believe will be too common - though there
could be an obsoletion period where comma still bypasses backquotes but
warns the user to change off of that behavior.  All code making use of
the new behavior will firmly be incompatible with older versions of
emacs for which this is not patched, however.





  reply	other threads:[~2024-07-29 20:59 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-28  0:40 bug#72328: [PATCH] Nested backquote in pcase Thuna
2024-07-28 14:52 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-28 15:51   ` Thuna
2024-07-28 16:02     ` Eli Zaretskii
2024-07-28 16:20       ` Thuna
2024-07-29 16:03     ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-29 16:45       ` Eli Zaretskii
2024-07-30  7:45         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-03  0:07           ` Thuna
2024-08-03  5:59             ` Eli Zaretskii
2024-08-03 13:22               ` Thuna
2024-08-04 17:10                 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-04 21:27                   ` Thuna
2024-08-05 11:52                     ` Eli Zaretskii
2024-08-05 19:32                       ` Thuna
2024-08-06  8:21                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-06 11:13                         ` Eli Zaretskii
2024-08-06 13:09                           ` Thuna
2024-08-07  3:33                             ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-07 11:53                               ` Eli Zaretskii
2024-08-07 17:34                               ` Thuna
2024-08-08  5:57                                 ` Eli Zaretskii
2024-08-23  3:25                                   ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-23 14:49                                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-23 16:04                                       ` Eli Zaretskii
2024-08-23 19:11                                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-23 19:29                                           ` Eli Zaretskii
2024-09-07  7:18                                             ` Eli Zaretskii
2024-09-07 12:24                                               ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-23 20:19                                         ` Thuna
2024-07-29 17:43       ` Thuna
2024-07-29 19:05         ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-29 20:45         ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-29 20:59           ` Thuna [this message]
2024-07-30 17:53             ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=87le1j29uw.fsf@gmail.com \
    --to=thuna.cing@gmail.com \
    --cc=72328@debbugs.gnu.org \
    --cc=michael_heerdegen@web.de \
    /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).