3 ms·
It makes it very easy to deal with nested data structures. Imagine creating a nested map/struct literal, and then extract the values out using a very similar sy
by nvarsj 4y ago
It makes it very easy to deal with nested data structures. Imagine creating a nested map/struct literal, and then extract the values out using a very similar syntax on a single line.
It's one of those things that when you get used to, you wonder why other languages don't implement it.
- Alifatisk 4y agoI think this answers the question very well, thank you. I found this [1] documentation from Ruby explain what it solves pretty good aswell. [1] https://docs.ruby-lang.org/en/3.0/syntax/pattern_matching_rdoc.html https://docs.ruby-lang.org/en/3.0/syntax/pattern_matching_rd...