[Pharo-project] smalltalk: breaking out of a loop..

sergio_101 sergio.rrd at gmail.com
Sun Nov 7 17:04:48 CET 2010


if i have an OrderedCollection called people..

if i have a million ordered pairs in there, and i wanna see af any one
of them (hasTenBucks = true).

i don't want to iterate all of them, i want to stop when i find that
one hasTenBucks..

so in something like:

people do: [ :person | (person hasTenBucks) ifTrue; [break out of loop] ]

ideas? thanks!

-- 
----
peace,
sergio
photographer, journalist, visionary

http://www.CodingForHire.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101




More information about the Pharo-project mailing list