GNU bug report logs - #72328
[PATCH] Nested backquote in pcase

Previous Next

Package: emacs;

Reported by: Thuna <thuna.cing <at> gmail.com>

Date: Sun, 28 Jul 2024 01:06:02 UTC

Severity: normal

Tags: patch

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Thuna <thuna.cing <at> gmail.com>
Cc: 72328 <at> debbugs.gnu.org
Subject: bug#72328: [PATCH] Nested backquote in pcase
Date: Mon, 29 Jul 2024 22:45:08 +0200
Thuna <thuna.cing <at> gmail.com> writes:

> 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?

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

Let's wait for Stefan then.


Michael.




This bug report was last modified 236 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.