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

Side by Side Diff: sdk/lib/core/int.dart

Issue 551063003: Add Iterable.range, List.range and int.to. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/core/iterable.dart » ('j') | sdk/lib/core/iterable.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.core; 5 part of dart.core;
6 6
7 /** 7 /**
8 * An arbitrarily large integer. 8 * An arbitrarily large integer.
9 * 9 *
10 * **Note:** When compiling to JavaScript, integers are 10 * **Note:** When compiling to JavaScript, integers are
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 * sign, the [onError] is called with the [source] as argument, and its return 268 * sign, the [onError] is called with the [source] as argument, and its return
269 * value is used instead. If no [onError] is provided, a [FormatException] 269 * value is used instead. If no [onError] is provided, a [FormatException]
270 * is thrown. 270 * is thrown.
271 * 271 *
272 * The [onError] function is only invoked if [source] is a [String]. It is 272 * The [onError] function is only invoked if [source] is a [String]. It is
273 * not invoked if the [source] is, for example, `null`. 273 * not invoked if the [source] is, for example, `null`.
274 */ 274 */
275 external static int parse(String source, 275 external static int parse(String source,
276 { int radix, 276 { int radix,
277 int onError(String source) }); 277 int onError(String source) });
278
279 /**
280 * Create an `Iterable<int>` iterating from `this` to `to`, inclusive.
281 *
282 * The iteration starts with `this` as the first value, and then
283 * progresses towards `to` in increments of `step`, and stops when reaching
284 * or overshooting `to`. If it hits `to` the `to` value is included,
285 * otherwise it isn't.
286 *
287 * If `to` is less than `from`, the values are in decreasing order.
288 *
289 * The [step] value must always be positive. It defaults to `1`.
290 *
291 * This is a shorthand for [Iterable.range].
292 */
293 static Iterable<int> to(int to, {int step: 1}) =>
294 return Iterable.range(this, to, step);
278 } 295 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/core/iterable.dart » ('j') | sdk/lib/core/iterable.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698