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
there is an idea for implicit/aggressive do expressions tc39/proposal-do-expressions#9 and facebook/jsx#88 (for jsx). This basically makes various statements in JS expressions (ex. switch would be an expression).
With this in mind, maybe instead of adding a new keyword match, improving switch would be a better idea. CSharp recently did something similar — they added special powers to good old switch statement instead of adding a new keyword (unfortunately switch is still a statement which sucks but we would avoid it).
I believe they are different. Do expression is trying to convert some statements into expressions, including the implicit one. Pattern matching is more than that, it can bind variable, it supports nested matching, not just something like switch.
Hey y'all! #65 has gotten merged, and a lot of issues have become irrelevant or significantly changed in context. Because of the magnitude of changes and subtle differences in things that seem similar, we've decided to just nuke all existing issues so we can start fresh. Thank you so much for the contributions and discussions and feel free to create new issues if something seems to still be relevant, and link to the original, related issue so we can have a paper trail (but have the benefit of that clean slate anyway).
As far as this goes: I am explicitly not intending to overload switch, and its semantics, on several levels, are very very different from the goal semantics of match, even if the high-level concept seems similar. The new spec takes a number of specs to distance itself from familiarity with switch for that reason.
Hi!
there is an idea for implicit/aggressive do expressions tc39/proposal-do-expressions#9 and facebook/jsx#88 (for jsx). This basically makes various statements in JS expressions (ex. switch would be an expression).
With this in mind, maybe instead of adding a new keyword
match
, improving switch would be a better idea. CSharp recently did something similar — they added special powers to good old switch statement instead of adding a new keyword (unfortunately switch is still a statement which sucks but we would avoid it).I wonder if this was discussed somewhere already?
CC: @xtuc
The text was updated successfully, but these errors were encountered: