Pattern Matching in Languages
Discussions revolve around pattern matching features in programming languages like Rust, Haskell, Python, Scala, and others, comparing it to switch statements, debating its usefulness, syntax, and implementations.
Activity Over Time
Top Contributors
Keywords
Sample Comments
What's the point of pattern matching? Why not just a switch statement?
It doesn't really pattern match like rust, but it's still very useful
Depends on the language, looks like this one can't do pattern matching? Makes you appreciate languages like Zig, Rust or Odin a lot more
Pattern matching syntax (eg in Rust) makes a big difference.
Are you using pattern matching in the sense of Standard ML and the ML family of languages?
match credulity: case woosh: print(“We were starting to worry that we would run out of major language changes to confuse new developers. But thanks to pattern matching, we should be set for another 5-7 years! ”)
Have you seen Reason yet? It has pattern matching.https://reasonml.github.io/docs/en/pattern-matching.html
This is pattern matching. Support for this exists in Haskell, Scala, and now even Ruby and soon Python.
Like any language with pattern matching. See Erlang, Haskell etc.
Is pattern matching a generalization of if/then/else, a reframing of it, or something else entirely?