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

Unified Diff: corelib/src/collection.dart

Issue 9114021: Added method map to Collection interface and all its implementations (except classes generated fr... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: corelib/src/collection.dart
===================================================================
--- corelib/src/collection.dart (revision 2973)
+++ corelib/src/collection.dart (working copy)
@@ -13,6 +13,16 @@
void forEach(void f(E element));
/**
+ * Returns a new collection with the elements [: f(e) :]
+ * for each element [e] of this collection.
+ *
+ * Note on typing: the return type of f() could be an arbitrary
+ * type R and consequently the returned collection's
+ * type would be Collection<R>.
ahe 2012/01/05 22:36:54 This comment is confusing. The static type may con
Ivan Posva 2012/01/05 22:47:03 I don't think this comment is entirely correct. Th
+ */
+ Collection map(f(E element));
+
+ /**
* Returns a new collection with the elements of this collection
* that satisfy the predicate [f].
*
@@ -21,6 +31,7 @@
*/
Collection<E> filter(bool f(E element));
ahe 2012/01/05 22:36:54 Extra line.
+
/**
* Returns true if every elements of this collection satisify the
* predicate [f]. Returns false otherwise.

Powered by Google App Engine
This is Rietveld 408576698