Collection.st
changeset 8863 3e7dc1b51635
parent 8858 a35d6c7eeee0
child 8893 99996b25482e
--- a/Collection.st	Wed Apr 20 16:59:45 2005 +0200
+++ b/Collection.st	Fri Apr 22 12:32:07 2005 +0200
@@ -1769,6 +1769,16 @@
     "
 !
 
+nonNilElementsDo:aBlock
+    "evaluate the argument, aBlock for every non-nil element in the collection."
+
+    self do:[:each |
+        each notNil ifTrue:[
+            aBlock value:each.
+        ]
+    ]
+!
+
 pairsDo:aBlock
     "evaluate the argument, aBlock for every element in the collection,
      which is supposed to consist of 2-element collections.
@@ -2812,7 +2822,7 @@
 !Collection class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.175 2005-04-20 09:25:56 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.176 2005-04-22 10:32:07 cg Exp $'
 ! !
 
 Collection initialize!