2 ms·
Surely it has everything to do with pattern matching? A C-style switch statement is an extremely primitive version of pattern matching, and in the article the f
by Sharlin 7y ago
Surely it has everything to do with pattern matching? A C-style switch statement is an extremely primitive version of pattern matching, and in the article the flattened equivalent of the nested switch structure is just tuple destructuring and matching, just like in Rust I could write
match (foo, bar, baz) {
(1, 2, 3) => something(),
(3, 2, 1) => somethingelse()
}