Closed
Description
This issue was originally filed by [email protected]
What steps will clearly show the issue / need for enhancement?
- Support of pattern matching (à la Scala/Ocaml/...)
- Add a match keyword
- Look at this POC https://code.google.com/p/dart-pattern-matching/
This answer sums up the advantages of having this (instead of just if/switch) http://stackoverflow.com/a/21355296/505810
Also this:
- It Allows to match on any sort of data with a first-match policy
- It meets a functional logic: each case statement returns a value and the whole match statement is virtually a function that returns the matching case value.