Subject: bug#75594: 31.0.50; [FR]: Change equality test for Pcase non-linear patterns

From: Michael Heerdegen <[email-masked]>
Date: Fri, 17 Jan 2025 02:01:47 +0100

Eshel Yaron <[email-masked]> writes:

> > I can see two possible syntax options:
> >
> > 1- some kind of "contextual" pcase macro like
> >
> >     (with-equality-predicate #'equal
> >       `(,foo ,foo ,foo))
> >
> > 2- some kind of VAR pattern but annotated with an equality predicate in
> >    case this is not the first use of this identifier, so you'd write
> >
> >     `(,(var foo #'equal) ,(var foo #'equal) ,(var foo #'equal))
>
> Both options sound good.  The need to repeat the equality predicate
> multiple times in option 2 makes it slightly less preferable, but it
> maybe it'd be easier to document/explain.

2 has the advantage that it allows mixing different predicates.  Dunno
if this is often useful, though.

I wonder how typical examples of this feature look like.  So far I
stumbled over the implicit equivalence test not being what I needed
sometimes, but not really often.

(Of course I'm open to add something (maybe more) convenient to el-search
if it is useful.)

Michael.