[svn] r7566: nemerle/trunk/lib/narray.n

VladD2 svnadmin at nemerle.org
Mon Apr 2 04:43:12 CEST 2007


Log:
Add 'Iter[T] (this source : SCG.IEnumerable [T], action : T -> void) : void' method to std lib.

Author: VladD2
Date: Mon Apr  2 04:43:09 2007
New Revision: 7566

Modified:
   nemerle/trunk/lib/narray.n

Modified: nemerle/trunk/lib/narray.n
==============================================================================
--- nemerle/trunk/lib/narray.n	(original)
+++ nemerle/trunk/lib/narray.n	Mon Apr  2 04:43:09 2007
@@ -103,6 +103,13 @@
     // 
     // Lazy functions
 
+    /// Iterate sequence and call action for each it elements.
+    public Iter[T] (this source : SCG.IEnumerable [T], action : T -> void) : void
+    {
+      foreach (elem in source)
+        action (elem);
+    }
+
     public FindIndex[T]([NotNull] this source : array[T], [NotNull] isMatch : T -> bool) : int
     {
       for (mutable i = 0; i < source.Length; i++)



More information about the svn mailing list