4 ms·
'It doesn't work in one particular language that happens to lack pattern matching, therefore it cannot work without pattern matching.' In particular, pattern m
by moonchild 6y ago
'It doesn't work in one particular language that happens to lack pattern matching, therefore it cannot work without pattern matching.'
In particular, pattern matching generally entails destructuring, which you do not need in order to make that particular example work.
- yawaramin 6y agoThe example is not just destructuring though. It's actually matching against a data constructor and in another branch binding a name to a value. Those are classic hallmarks of pattern matching.