or-patterns Marc Nieper-Wißkirchen (25 Aug 2020 08:52 UTC)
Re: or-patterns Alex Shinn (26 Aug 2020 07:08 UTC)

or-patterns Marc Nieper-Wißkirchen 25 Aug 2020 08:52 UTC

How do or-patterns exactly work when variables are involved?

The following expression

(match 1 ((or (and 1 x) (and 2 y)) x))

gives an error about an undefined variable `y` in the current match
implementation in Chibi. From the documentation, I would have thought
that the result of the above expression is `1` because in the
specification it says: "All identifiers from all subpatterns are bound
if the or operator matches."

Marc