Feature request: Customize equality predicate for pattern variables
(no sender)
(05 Sep 2020 15:20 UTC)
|
||
Re: Feature request: Customize equality predicate for pattern variables
Felix Thibault
(13 Sep 2020 10:25 UTC)
|
||
Re: Feature request: Customize equality predicate for pattern variables (no sender) (13 Sep 2020 13:08 UTC)
|
||
Re: Feature request: Customize equality predicate for pattern variables
Felix Thibault
(13 Sep 2020 13:41 UTC)
|
||
Re: Feature request: Customize equality predicate for pattern variables
(no sender)
(13 Sep 2020 13:55 UTC)
|
||
(missing)
|
||
(missing)
|
||
Re: Feature request: Customize equality predicate for pattern variables
Felix Thibault
(18 Sep 2020 22:56 UTC)
|
||
Re: Feature request: Customize equality predicate for pattern variables
Felix Thibault
(20 Sep 2020 01:04 UTC)
|
Re: Feature request: Customize equality predicate for pattern variables Marc Nieper-WiÃkirchen 13 Sep 2020 13:08 UTC
Felix, thanks for this suggestion. It's a good one if pattern variables are bound early and in the lexical tree order of the pattern. When they are not (and I still believe that this is the much simpler, clearer, and a lot better optimizable semantics), it doesn't work, though. What would you think of adding a special pattern clause that declares an equivalence predicate for pattern variables? E.g. as follows: (match (<pat> . <body>) ...) is replaced by (match (<top-pat> . <body>) ...) and <top-pat> is either <pat> or (<decl> <pat>) where <decl> is some meta-information (extensible), which can include declare equivalence predicates for certain pattern variables. This meta-information can also be used to restrict (or extend) the number of special identifiers to make the match pattern language future-proof.