Skip to content

Support pattern matching #21847

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DartBot opened this issue Dec 11, 2014 · 6 comments
Closed

Support pattern matching #21847

DartBot opened this issue Dec 11, 2014 · 6 comments
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Dec 11, 2014

This issue was originally filed by [email protected]


What steps will clearly show the issue / need for enhancement?

  1. Support of pattern matching (à la Scala/Ocaml/...)
  2. Add a match keyword
  3. 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.
@lrhn
Copy link
Member

lrhn commented Dec 11, 2014

Added Area-Language, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Dec 11, 2014

This comment was originally written by @zoechi


looks like a dup of http://dartbug.com/2949

@DartBot
Copy link
Author

DartBot commented Dec 11, 2014

This comment was originally written by [email protected]


And what's that label for (on the possible dup) "-Oldschool-Milestone-Later"

@DartBot
Copy link
Author

DartBot commented Dec 11, 2014

This comment was originally written by @zoechi


I don't know. I just had the feeling that I already saw such a request, looked it up and added the link so others don't have to do the search again.
I'm also curious what this label means.

@DartBot
Copy link
Author

DartBot commented Dec 11, 2014

This comment was originally written by [email protected]


Ok... But yes the request looks pretty similar indeed.

@gbracha
Copy link
Contributor

gbracha commented Dec 23, 2014

Added Duplicate label.
Marked as being merged into #2949.

@DartBot DartBot added Type-Enhancement area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report labels Dec 23, 2014
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed priority-unassigned labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants