GNU bug report logs -
#72328
[PATCH] Nested backquote in pcase
Previous Next
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
Message #29 received at 72328 <at> debbugs.gnu.org (full text, mbox):
Thuna <thuna.cing <at> gmail.com> 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.
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.