Skip to content

Building a new collection out of an existing one is too imperative #46

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
munificent opened this issue Oct 15, 2018 · 2 comments
Closed
Labels
request Requests to resolve a particular developer problem

Comments

@munificent
Copy link
Member

Dart has a nice declarative syntax for creating new lists and maps (and eventually probably sets) from a series of elements:

var list = [1, 2, 3];
var map {key: value};

This works well when building a collection out of individual elements. But if you want to insert the contents of an existing collection, you are forced to use an imperative, mutating API:

var args = testArgs.toList()
  ..add('--packages=${PackageMap.globalPackagesPath}')
  ..add('-rexpanded')
  ..addAll(filePaths);
@munificent munificent added the request Requests to resolve a particular developer problem label Oct 15, 2018
@kevmoo
Copy link
Member

kevmoo commented Nov 5, 2019

@munificent – could this issue be considered closed by the spread collection work?

@munificent
Copy link
Member Author

Yes! This issue is the problem the feature was designed to solve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request Requests to resolve a particular developer problem
Projects
None yet
Development

No branches or pull requests

2 participants