It would be nice to be able to have pattern matching that read conveniently with infix notation.
In the case of defining a vex, it looks something like this
(vex optional-name call-binding env-binding & body)
Here's a simple example:
The call binding is (_ it), which can match a call with one argument and ignores the foo. But what do we do when we want to bind the whole call as well, for error purposes?
Most languages fall back on infix here, and indeed we can parse infix, but only if there are spaces around the operator. Otherwise, we are into the realm of things like two classes of symbol character and transitioning between them causes a split.
It would be nice to be able to have pattern matching that read conveniently with infix notation.
In the case of defining a vex, it looks something like this
Here's a simple example:
The call binding is
(_ it), which can match a call with one argument and ignores thefoo. But what do we do when we want to bind the whole call as well, for error purposes?Most languages fall back on infix here, and indeed we can parse infix, but only if there are spaces around the operator. Otherwise, we are into the realm of things like two classes of symbol character and transitioning between them causes a split.