Collection.st
changeset 21647 a27784bdb210
parent 21631 b0e8d73f8f49
child 21650 61639cef6166
--- a/Collection.st	Wed Mar 15 17:42:06 2017 +0100
+++ b/Collection.st	Wed Mar 15 18:21:10 2017 +0100
@@ -14,11 +14,11 @@
 "{ NameSpace: Smalltalk }"
 
 Object subclass:#Collection
-	instanceVariableNames:''
-	classVariableNames:'EmptyCollectionSignal InvalidKeySignal NotEnoughElementsSignal
-		ValueNotFoundSignal'
-	poolDictionaries:''
-	category:'Collections-Abstract'
+        instanceVariableNames:''
+        classVariableNames:'EmptyCollectionSignal InvalidKeySignal NotEnoughElementsSignal
+                ValueNotFoundSignal'
+        poolDictionaries:''
+        category:'Collections-Abstract'
 !
 
 !Collection class methodsFor:'documentation'!
@@ -2412,6 +2412,35 @@
     "Modified: / 11.2.2000 / 11:22:14 / cg"
 !
 
+and:aSecondCollection and:aThirdCollection do:aBlock
+    "evaluate the argument, aBlock for each element in the receiver,
+     then for each element in aSecondCollection, then for each in aThirdCollection."
+
+    self do:aBlock.
+    aSecondCollection do:aBlock.
+    aThirdCollection do:aBlock.
+
+    "
+     #(1 2 3) and: #(a b c) and: #(x y z) do:[:each | Transcript showCR:each]
+    "
+
+    "Created: / 15-03-2017 / 18:19:34 / cg"
+!
+
+and:aSecondCollection do:aBlock
+    "evaluate the argument, aBlock for each element in the receiver,
+     then for each element in aSecondCollection."
+
+    self do:aBlock.
+    aSecondCollection do:aBlock.
+
+    "
+     #(1 2 3) and: #(a b c) do:[:each | Transcript showCR:each]
+    "
+
+    "Created: / 15-03-2017 / 18:19:03 / cg"
+!
+
 collect:aBlock
     "for each element in the receiver, evaluate the argument, aBlock
      and return a new collection with the results"