GNU bug report logs -
#75594
31.0.50; [FR]: Change equality test for Pcase non-linear patterns
Previous Next
Full log
View this message in rfc822 format
Eshel Yaron <me <at> eshelyaron.com> 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.
This bug report was last modified 151 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.