help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] Re: How to exit loops?


From: Paolo Bonzini
Subject: Re: [Help-smalltalk] Re: How to exit loops?
Date: Thu, 10 Jul 2008 16:17:56 +0200
User-agent: Thunderbird 2.0.0.14 (Macintosh/20080421)

Forgot a usual fourth way:

you also forgot an "un" before usual, didn't you? :-)

nice trick, but i've never seen it anywhere!

4) use a Stream.

exit := false.
stream := (1 to: 10) readStream.
[ exitLoop or: [stream atEnd]]
    whileFalse: [| x |
        x := stream next.
        x = 3
            ifTrue: [exit := true]
            ifFalse: [...]].

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]