OrderedCollection.st
changeset 3 24d81bf47225
parent 2 6526dde5f3ac
child 5 67342904af11
--- a/OrderedCollection.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/OrderedCollection.st	Wed Oct 13 01:19:00 1993 +0100
@@ -31,7 +31,7 @@
 firstIndex      <SmallInteger>  index of first valid element
 lastIndex       <SmallInteger>  index of last valid element
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/OrderedCollection.st,v 1.3 1993-10-13 00:16:51 claus Exp $
 written spring 89 by claus
 '!
 
@@ -356,6 +356,15 @@
     contentsArray from:firstIndex to:lastIndex do:aBlock
 !
 
+keysAndValuesDo:aTwoArgBlock
+    "evaluate the argument, aBlock for every element in the collection,
+     passing both index and element as arguments."
+
+    firstIndex to:lastIndex do:[:index |
+        aTwoArgBlock value:index value:(contentsArray at:index)
+    ]
+!
+
 collect:aBlock
     "evaluate the argument, aBlock for every element in the collection
      and return a collection of the results"