The Trunk: Collections-cmm.431.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Collections-cmm.431.mcz

commits-2
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
+ !