[Newbies] next or break in a loop

2016-05-10 Thread Louis LaBrunda
Joe, At each test for the type of data you can also test to see if you found type, something like this: stream := ReadStream on: myCollection. [stream atEnd] whileFalse: [:item | | notFound | item := stream next. notFound := true.

[Newbies] next or break in a loop

2016-05-09 Thread Louis LaBrunda
Hi Joe, You can map your collection to a stream and then use the stream methods to traverse the collection. stream := ReadStream on: myCollection. [stream atEnd] whileFalse: [:item | item := stream next. "I'm not sure upToEnd is the right method here but it is

Re: [Newbies] next or break in a loop

2016-05-09 Thread Tobias Pape
Hi Joseph, On 09.05.2016, at 19:51, Joseph Alotta wrote: > Greetings, > > I am in need of a way to go to the end of a do loop. > > myCollection do: [ :item | > >(blah blah) ifTrue: “we found an item of the first type” > next item. >

Re: [Newbies] next or break in a loop

2016-05-09 Thread Phil (list)
On Mon, 2016-05-09 at 20:51 +0200, Bert Freudenberg wrote: > On 09.05.2016, at 20:35, Phil (list) wrote: > > > > > > Smalltalk doesn't have a switch/case statement > True, but Squeak does: > > aValue caseOf: { > [firstValue] -> [firstBlock]. >

Re: [Newbies] next or break in a loop

2016-05-09 Thread Bert Freudenberg
On 09.05.2016, at 20:35, Phil (list) wrote: > > Smalltalk doesn't have a switch/case statement True, but Squeak does: aValue caseOf: { [firstValue] -> [firstBlock]. [secondValue] -> [secondBlock]. } otherwise: [elseBlock] -

Re: [Newbies] next or break in a loop

2016-05-09 Thread Phil (list)
On Mon, 2016-05-09 at 12:51 -0500, Joseph Alotta wrote: > Greetings, > > I am in need of a way to go to the end of a do loop. > > myCollection do:  [ :item | > > (blah blah) ifTrue: “we found an item of the first > type” >  next item. > > (blah

[Newbies] next or break in a loop

2016-05-09 Thread Joseph Alotta
Greetings, I am in need of a way to go to the end of a do loop. myCollection do: [ :item | (blah blah) ifTrue: “we found an item of the first type” next item. (blah blah) ifTrue: “we found an item of the second type” next item.