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