Subject: bug#72328: [PATCH] Nested backquote in pcase

From: Michael Heerdegen <[email-masked]>
Date: Mon, 29 Jul 2024 21:05:11 +0200

Thuna <[email-masked]> writes:

> 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))))
>
> Which currently errors on two counts: 1. ,,a in the pattern first
> expands the initial , as though it escape the backquote pattern (not the
> one before (,bar...) but the one before (69...))  and tries to match the
> object - which is (\, 1) - against the pattern ,a which is of course
> nonsense so the macroexpansion fails.  2. ,bar in the pattern tries to
> match the corresponding object - which is (\, bar) - against the pattern
> `bar' which binds the object - once again (\, bar) - to `bar'.

I see, thanks.  Yes, I misinterpreted what you wanted to do in your
patch.

> Do you disagree that the result of this form should also be (1 2)?

Maybe.  I have to think about it.

Michael.