Skip to content

Language Feature: Parallel Assignment #10267

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 Apr 29, 2013 · 2 comments
Closed

Language Feature: Parallel Assignment #10267

DartBot opened this issue Apr 29, 2013 · 2 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 Apr 29, 2013

This issue was originally filed by @simonpai


Maybe it's possible to support parallel assignment like in Ruby and Python. For example:

// return domain, port,
(String, int) parseURL(String url) { ... }

String domain;
int port;
(domain, port) = parseURL('http://dart.com:9999'); // gets domain = 'dart.com', port = 9999

or even more elegantly:

(String domain, int port) = parseURL('http://dart.com:9999');

Dart should be able to keep the all type information in compile time, so it has benefit over returning an unparametrized List. But I am not sure how many effort it takes to implement this.

This is not a must-have feature, but shall come in handy when you need it.

@jmesserly
Copy link

Removed Type-Defect label.
Added Type-Enhancement, Area-Language, Triaged labels.

@jmesserly
Copy link

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

@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 Apr 29, 2013
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement 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

3 participants