-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Optional patterns: sub-pattern that is enclosed in [ ]
, it is considered optional. When that particular sub-pattern is not matched, it's skipped without rejecting the input.
Examples:
`(call append xs [0] 1 2)`
This pattern matches both append(xs, 0, 1, 2) and append(xs, 1, 2).
`(call f [(call g1) (call g2)])`
Optional part can contain arbitrary sub-patterns.
TODO: does `[a b]` pattern mean that b is only matched if a matched or
it's just a convenient syntax for `[a] [b]`?
Alternation: like A|B
in regular expressions.
TODO: make decision on syntax.
Repetitions: like A+
and/or A{min,max}
in regular expressions.
TODO: make decision on syntax.
Negative patterns: patterns that fail if they do match.
TODO: make decision on syntax.
Sub-pattern grouping: sub-patterns that are enclosed in { }
can be treated as a single sub-pattern. This means that any modifiers or operations that are defined for single sub-pattern become possible for a list of sub-patterns.
TODO: examples.
Metadata
Metadata
Assignees
Labels
No labels