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
When using switch with multiple case receivers, it's important to understand that it works differently than in control flow languages. For example:
switch {
['Alice', 'Bob'] -> upper
_ -> lower
}
Is not "if either Alice or Bob then do uppercase". It's a fan-in, which means Alice and Bob are concurrent to each other. Switch will select first value that will be sent as a case value, which is in this case random, because both values are message literals
The text was updated successfully, but these errors were encountered:
When using switch with multiple case receivers, it's important to understand that it works differently than in control flow languages. For example:
Is not "if either Alice or Bob then do uppercase". It's a fan-in, which means
Alice
andBob
are concurrent to each other. Switch will select first value that will be sent as a case value, which is in this case random, because both values are message literalsThe text was updated successfully, but these errors were encountered: