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

Max Leske maxleske at gmail.com
Sun Nov 7 17:08:13 CET 2010


use #dectect: 


On 07.11.2010, at 17:04, sergio_101 wrote:

> 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