Skip to content

More general list matching #7

Open
@mbravenboer

Description

@mbravenboer

It would be really nice if we could write patterns like this:

[xs..., p(x), ys...]

This would match the first p(x) in the list. It's important here that matching is not greedy. Some ad-hoc support could be implement, but it gets quickly more challenging to cover all cases correctly. I believe we should compile the patterns into an automaton like regular expressions. The design of this would need to be worked out in some more detail.

Some quick thoughts:

  • P... would be like P* , and P should match the elements, not the entire list.
  • It would be nice to support more regular expression operators, but we'd have to get a bit creative with mapping those Julia syntax? I don't immediately see great use-cases for those.

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