Open varnerac opened 3 years ago
We support this at the top level, but not nested yet.
case x {
1 | 2 -> "one or two"
_ -> "other"
}
It would be good to have this nested syntax too, though implementation seems like it could be tricky.
Ok, I am embarrassed I was too lazy to scroll down the page. Gonna close.
Oh no let's keep this open! The example you've given won't compile! It would be great if we could have that functionality as well.
Oh, okay
Thank you! This will be a big improvement :)
On Thu, 7 Jan 2021, 17:48 Andrew Varner, notifications@github.com wrote:
Oh, okay
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/gleam-lang/suggestions/issues/115#issuecomment-756272939, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABOZVBQ4XZQX37M2F4FEHR3SYXXVVANCNFSM4VZDEBYA .
Rust and ReasonML allow you to combine patterns in switch/case statements. I think it's nice.