Skip to content

Infix operators #1

@jjl

Description

@jjl

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:

(vex foo (_ it) _ it)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions