2 ms·
> I'm tempted to advocate adding operator overloading, so | would make a pattern that matches any one of two alternatives, * would be used for specifying repeat
by masklinn 9y ago
> I'm tempted to advocate adding operator overloading, so | would make a pattern that matches any one of two alternatives, * would be used for specifying repeats, etc. So you could write
For repeat I think using indexing would make more sense though it might look somewhat unusual:
Pattern[:]
would be *
Pattern[1:]
would be + aka {1,}
Pattern[5]
would be {5}
Pattern[m:n]
would be {m,n}
It also uses a single operator for all repetition operations which is nice.
- deleted 9y ago[deleted]