[squeak-dev] The Trunk: Collections-cmm.431.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Mar 5 20:23:42 UTC 2011


Chris Muller uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-cmm.431.mcz

==================== Summary ====================

Name: Collections-cmm.431
Author: cmm
Time: 5 March 2011, 2:23:24.654 pm
UUID: 81bff0a8-276a-4011-ab91-9a7102fdf741
Ancestors: Collections-ul.430

- Added Collection>>#detect:ifFound:ifNone:.

=============== Diff against Collections-ul.430 ===============

Item was added:
+ ----- Method: Collection>>detect:ifFound:ifNone: (in category 'enumerating') -----
+ detect: aBlock ifFound: foundBlock ifNone: exceptionBlock 
+ 	"foundBlock takes one argument, the found object."
+ 	self 
+ 		do: [ :element | (aBlock value: element) ifTrue: [ ^foundBlock value: element ] ].
+ 	^exceptionBlock value
+ !




More information about the Squeak-dev mailing list