Index: sdk/lib/core/list.dart |
diff --git a/sdk/lib/core/list.dart b/sdk/lib/core/list.dart |
index b4948a3c1680aa616a39f6b605ea2363296015cb..1c5eafb9acfc5b53ab6245f3df322a7bfc3b79f3 100644 |
--- a/sdk/lib/core/list.dart |
+++ b/sdk/lib/core/list.dart |
@@ -9,18 +9,24 @@ |
interface List<E> extends Collection<E>, Sequence<E> |
default _ListImpl<E> { |
/** |
- * Creates a list of the given [length]. |
- * |
- * If no [length] argument is supplied an extendable list of |
- * length 0 is created. |
- * |
- * If a [length] argument is supplied, a fixed size list of that |
- * length is created. |
+ * Creates an extendable list of the given [length]. |
sra1
2012/11/07 21:36:34
'extendable' is not quite right since it can be sh
floitsch
2012/11/12 13:21:50
reworded.
|
*/ |
- List([int length]); |
+ List([int length = 0]); |
/** |
- * Creates a list with the elements of [other]. The order in |
+ * Creates a fixed-sized list of the given [length] where each entry is |
+ * filled with [fill]. |
+ */ |
+ List.fixedLength(int length, {E fill: null}); |
+ |
+ /** |
+ * Creates an extendable list of the given [length] where each entry is |
+ * filled with [fill]. |
+ */ |
+ List.filled(int length, E fill); |
sra1
2012/11/07 21:36:34
It is a pity that 'fill' is a named parameter in o
floitsch
2012/11/12 13:21:50
Completely agree. There is bug open, but currently
|
+ |
+ /** |
+ * Creates an extandable list with the elements of [other]. The order in |
sra1
2012/11/07 21:36:34
extEndable, if you keep the name.
floitsch
2012/11/12 13:21:50
Reworded.
|
* the list will be the order provided by the iterator of [other]. |
*/ |
List.from(Iterable<E> other); |
@@ -179,9 +185,21 @@ class _ListImpl<E> { |
/** |
* Factory implementation of List(). |
* |
- * Creates a list of the given [length]. |
+ * Creates an extendable list of the given [length]. |
+ */ |
+ external factory List([int length = 0]); |
+ |
+ /** |
+ * Creates a fixed-sized list of the given [length] where each entry is |
+ * filled with [fill]. |
+ */ |
+ external factory List.fixedLength(int length, {E fill: null}); |
+ |
+ /** |
+ * Creates an extendable list of the given [length] where each entry is |
+ * filled with [fill]. |
*/ |
- external factory List([int length]); |
+ external factory List.filled(int length, E fill); |
/** |
* Factory implementation of List.from(). |