You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible (and useful) to have match accept multiple expressions? Each match expression will match the corresponding case expression and evaluated as an and for each expression in a case.
locala, b=2, 5matcha, b+1 {
1, a=> { print('no') }
2, 4=> { print('neither') }
b-1, 6=> { print('nay') }
2, a*3=> { print('THIS CASE will be selected') }
}
If implemented, will probably be neater to have "passthrough" case expressions too, that technically works as a wildcard that always matches for that case expression, albeit it might be difficult to come up with a symbol (or existing keyword) for it.
The text was updated successfully, but these errors were encountered:
Oops, fixed that. Also unknowingly removed the print parentheses.
As for the latter concern, they do work and end up being if (_internal0 == b-1), etc. The precedence is another story, but in this case it's not a worry (yet)
Oops, fixed that. Also unknowingly removed the print parentheses.
As for the latter concern, they do work and end up being if (_internal0 == b-1), etc. The precedence is another story, but in this case it's not a worry (yet)
this is if statement is basically unintended behavior, since b won’t be defined to what you would expect it to be?
Would it be possible (and useful) to have
match
accept multiple expressions? Each match expression will match the corresponding case expression and evaluated as anand
for each expression in a case.If implemented, will probably be neater to have "passthrough" case expressions too, that technically works as a wildcard that always matches for that case expression, albeit it might be difficult to come up with a symbol (or existing keyword) for it.
The text was updated successfully, but these errors were encountered: