_This issue was originally filed by binary...@binarysplit.com_
Destructuring Assignment is a feature of Javascript 1.7. MDC has a good guide: https://developer.mozilla.org/en/New_in_JavaScript_1.7#Destructuring_assignment_%28Merge_into_own_page.2Fsection%29
Essentially, it provides a significant reduction in code size when dealing with multiple return values, iteration over zipped arrays or arrays of objects, and shuffles.
I suspect this feature is already in the Dart roadmap (due to it already being in Javascript). I just want to make sure it's publicly acknowledged and open for discussion.
_This comment was originally written by binary...@binarysplit.com_
Duplicate of Issue #35( http://code.google.com/p/dart/issues/detail?id=35 ).
Which name is better? I find "Pattern Matching" to be somewhat ambiguous, as it shares a name with Scala's "match" statement( http://www.scala-lang.org/node/120 ) and Perl's RegExs.
_This comment was originally written by [email protected]_
Issue #35 has been merged into this issue.
It is possible we'll do something in this space in time. Please note the difference between a feature request and a defect when filing bugs.
_Set owner to @gbracha._
_Removed Type-Defect label._
_Added Type-Enhancement label._
_This comment was originally written by [email protected]_
Issue #97 has been merged into this issue.
_Added apr30-triage label._
_Removed apr30-triage label._
_Added triage1 label._
_This comment was originally written by devin.t...@gmail.com_
Any link to the relevant issue for implementing pattern matching?
Issue #10267 has been merged into this issue.
see this issue for pattern matching: https://code.google.com/p/dart/issues/detail?id=2949
_This comment was originally written by @simonpai_
Pattern matching is a different idea and it does not cover destructing assignment. It's literally wrong to close this ticket because of pattern matching.
_This comment was originally written by @tomyeh_
Destructing assignment is similar to the parallel assignment in Ruby (http://codeofpractice.blogspot.tw/2010/05/parallel-assignment-in-ruby.html), right?
It is quite helpful if a function needs to return two or more objects of different types (strong typed and no class required). I don't see if pattern matching can help here.
_This comment was originally written by tjp...@gmail.com_
Agreed with #颅13. Destructuring assignment is a useful _part_ of common pattern matching features. It's very useful elsewhere, too.
_This comment was originally written by unis...@gmail.com_
Clojure also supports pretty advanced destructuring:
http://clojure.org/special_forms#Special%20Forms--Binding%20Forms%20%28Destructuring%29
http://blog.jayfields.com/2010/07/clojure-destructuring.html
9 years later, end of 2020 and we still don't have it lel
Most helpful comment
9 years later, end of 2020 and we still don't have it lel