[Newbies] Does Smalltalk have "break" method to jump out of a loop ?
bernhard at pieber.com
Fri Nov 17 05:29:37 UTC 2017
There is none because there are no loops just message sends. What we have is the return statement that exits the whole method, which is oftenn used instead. If you post your Smalltalk code with a break statement I can show you how I would rewrite it to be idiomatic Smalltalk.
> Am 17.11.2017 um 06:21 schrieb RedTigerFish <chihuyu at gmail.com>:
> In C loop, there is break method which allows the program to jump out of the
> loop when certain criteria has been met.
> What is the counterpart in Smalltalk if there's one?
> Dig, dig where you are,
> Down below's well.
> Let those that walk in darkness shout,
> Down below's hell.
> Sent from: http://forum.world.st/Squeak-Beginners-f107673.html
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
More information about the Beginners