Open MovingtoMars opened 8 years ago
Boom found it, though we still haven't decided on the patterns for inclusive and exclusive ranges... which is really something we need to figure out since we've been debating it ever since. @kiljacken @vnev @raoulvdberge @MovingtoMars
As long as we do support for custom iterators, Liam's proposal of n .. m
including n excluding m, is probably fine to go with.
On Fri, Jan 22, 2016, 13:55 Felix Angell notifications@github.com wrote:
Boom found it https://github.com/ark-lang/ark/issues/534, though we still haven't decided on the patterns for inclusive and exclusive ranges... which is really something we need to figure out since we've been debating it ever since. @kiljacken https://github.com/kiljacken @vnev https://github.com/vnev @raoulvdberge https://github.com/raoulvdberge @MovingtoMars https://github.com/MovingtoMars
— Reply to this email directly or view it on GitHub https://github.com/ark-lang/ark/issues/643#issuecomment-173913368.
Just updated.
I should add that the match statement is exhaustive, i.e. it wants every possible outcome specified, or a default case to handle unspecified conditions.
The enum matching and destructuring part is implemented as of #686. The rest, including exhaustiveness checking, still remains.
How about using commas for matching multiple values?
match 5 {
1, 2..4, 5, 7 -> io::println("yes");
}
This then makes |
available when matching against boolean expressions.
:+1:
:arrow_up: @SamTebbs33
Value matching
Range Matching
Multiple Pattern Matching
Matching with a conditional
Destructuring