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.
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
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.
>
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].
>
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]
-
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
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.