--- a/Dict.st Mon Jun 10 20:27:05 1996 +0200
+++ b/Dict.st Thu Jun 13 00:07:54 1996 +0200
@@ -10,6 +10,8 @@
hereby transferred.
"
+'From Smalltalk/X, Version:2.10.9 on 11-jun-1996 at 16:33:26' !
+
Set subclass:#Dictionary
instanceVariableNames:'valueArray'
classVariableNames:''
@@ -1249,6 +1251,20 @@
^ Array basicNew:n
! !
+!Dictionary methodsFor:'searching'!
+
+findFirstKey:aBlock
+ "find and return the first key, for which evaluation of the argument, aBlock
+ returns true; return nil if none detected."
+
+ self keysDo:[:key |
+ (aBlock value:key) ifTrue:[^ key].
+ ].
+ ^ nil
+
+ "Created: 5.6.1996 / 11:55:50 / stefan"
+! !
+
!Dictionary methodsFor:'testing'!
includes:anObject
@@ -1306,5 +1322,5 @@
!Dictionary class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Attic/Dict.st,v 1.42 1996-05-20 15:47:19 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Attic/Dict.st,v 1.43 1996-06-12 22:07:54 stefan Exp $'
! !
--- a/Dictionary.st Mon Jun 10 20:27:05 1996 +0200
+++ b/Dictionary.st Thu Jun 13 00:07:54 1996 +0200
@@ -10,6 +10,8 @@
hereby transferred.
"
+'From Smalltalk/X, Version:2.10.9 on 11-jun-1996 at 16:33:26' !
+
Set subclass:#Dictionary
instanceVariableNames:'valueArray'
classVariableNames:''
@@ -1249,6 +1251,20 @@
^ Array basicNew:n
! !
+!Dictionary methodsFor:'searching'!
+
+findFirstKey:aBlock
+ "find and return the first key, for which evaluation of the argument, aBlock
+ returns true; return nil if none detected."
+
+ self keysDo:[:key |
+ (aBlock value:key) ifTrue:[^ key].
+ ].
+ ^ nil
+
+ "Created: 5.6.1996 / 11:55:50 / stefan"
+! !
+
!Dictionary methodsFor:'testing'!
includes:anObject
@@ -1306,5 +1322,5 @@
!Dictionary class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Dictionary.st,v 1.42 1996-05-20 15:47:19 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Dictionary.st,v 1.43 1996-06-12 22:07:54 stefan Exp $'
! !