Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Issue 551063003: Add Iterable.range, List.range and int.to. (Closed)

Created:
6 years, 3 months ago by Lasse Reichstein Nielsen
Modified:
5 years, 4 months ago
Reviewers:
Søren Gjesse, floitsch
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add Iterable.range, List.range and int.to. BUG= http://dartbug.com/20835

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+73 lines, -0 lines) Patch
M sdk/lib/core/int.dart View 1 chunk +17 lines, -0 lines 0 comments Download
M sdk/lib/core/iterable.dart View 1 chunk +24 lines, -0 lines 1 comment Download
M sdk/lib/core/list.dart View 1 chunk +32 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (1 generated)
Lasse Reichstein Nielsen
Comments on API, please. I went with a static method instead of a constructor, because ...
6 years, 3 months ago (2014-09-09 09:16:45 UTC) #2
floitsch
DBC. https://codereview.chromium.org/551063003/diff/1/sdk/lib/core/iterable.dart File sdk/lib/core/iterable.dart (right): https://codereview.chromium.org/551063003/diff/1/sdk/lib/core/iterable.dart#newcode61 sdk/lib/core/iterable.dart:61: * or overshooting `to`. If it hits `to` ...
6 years, 3 months ago (2014-09-09 09:37:14 UTC) #3
floitsch
I don't think that we should add these methods. We discussed them at length a ...
6 years, 3 months ago (2014-09-09 09:38:30 UTC) #4
Søren Gjesse
On 2014/09/09 09:38:30, floitsch wrote: > I don't think that we should add these methods. ...
6 years, 3 months ago (2014-09-09 09:45:54 UTC) #5
Lasse Reichstein Nielsen
6 years, 3 months ago (2014-09-09 09:48:17 UTC) #6
> Couldn't we fit the generation of integer lists into the collection package?

It's already in quiver, so no need for that. The real point here is the
shorthand 2.to(5), which is on int.
The two other methods are just parallel operations - the real implementation,
and a shorthand for createRange().toList().

(And I think the end should be included because it is not an index, it is a
value. We only generally exclude end indices).

Powered by Google App Engine
This is Rietveld 408576698