Feature request: Customize equality predicate for pattern variables Marc Nieper-Wißkirchen (05 Sep 2020 15:20 UTC)
Re: Feature request: Customize equality predicate for pattern variables Marc Nieper-Wißkirchen (13 Sep 2020 13:08 UTC)
Re: Feature request: Customize equality predicate for pattern variables Marc Nieper-Wißkirchen (13 Sep 2020 13:55 UTC)
(missing)
(missing)

Feature request: Customize equality predicate for pattern variables Marc Nieper-Wißkirchen 05 Sep 2020 15:20 UTC

When a pattern variable is repeated, the matcher compares the new with
the old value using equal?. This makes a lot of sense when all that is
matched are lists and vectors. In general, however, we can also match
records or use custom predicates (through the ? operator). In view of
this, unconditionally using equal? for repeated pattern variables is
arbitrary.

So what I am looking for is a way to associate with a (repeated)
pattern variable an equivalence predicate, which will then be used by
the matcher. So, in some sense, pattern variables need to be "typed"
for giving repeated pattern variables complete sense.