3 ms·
But if you had a syntax that allowed inner/embedded functions, exhaustive matching, and the ability to combine a|b..e, you might never ever EVER need fallthroug
by touisteur 6y ago
But if you had a syntax that allowed inner/embedded functions, exhaustive matching, and the ability to combine a|b..e, you might never ever EVER need fallthrough. The case statement in Ada is the best control flow structure (I'm not very familiar with advanced FP-style pattern matching, but I can read and follow Ada's with almost closed eyes, and they're exhaustive by default you won't compile until you've handled all the cases), and Ada2012 added case- and if-expressions, and now it seems there's some ongoing work on making it a bit more powerful...
This kind of construction makes the power of enumerated types, and restricted range types so much more evident.
- StillBored 6y agoWithout a doubt, even pascal's case statement is better syntactically. It also happens to be more terse.
- georgeecollins 6y agoSometimes I miss Pascal.