Slash will not have a switch statement, but rather a match statement. The key difference, as I see it, is that the switch statement has at most one possible match for each possibility (which can lead to optimizations like a simple index into a table). We don't care about being super fast, so the conjectured performance drawback is not an issue. I want the match statement to be more flexible and by extension more powerful than the classical switch statement found in C.
I am unsure exactly how the syntax will look and how precisely it will match. I think a powerful match statement requires an underlying and powerful pattern matching system built into the language.
Slash will not have a switch statement, but rather a match statement. The key difference, as I see it, is that the switch statement has at most one possible match for each possibility (which can lead to optimizations like a simple index into a table). We don't care about being super fast, so the conjectured performance drawback is not an issue. I want the match statement to be more flexible and by extension more powerful than the classical switch statement found in C.
I am unsure exactly how the syntax will look and how precisely it will match. I think a powerful match statement requires an underlying and powerful pattern matching system built into the language.