Hacker News new | ask | show | jobs
by moonchild 1959 days 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.

1 comments

The 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.