[Newbies] Infinite loops
Michael Rice
limitcase at gmail.com
Fri Dec 8 02:34:21 UTC 2017
Change your test condition to limit your infinite loop.
x := 0. [x <= 4] whileTrue: [x := x +1. Transcript show: 'infinite loop ',
x; cr].
infinite loop 1
infinite loop 2
infinite loop 3
infinite loop 4
infinite loop 5
Even in a language that supports a "break" command the user must specify
the condition for the break in his code.
On Thu, Dec 7, 2017 at 11:59 AM, obrienj <obrienj at protonmail.com> wrote:
> I’m using a MacBook Pro and can’t find a way to escape an infinite loop
> such as this:
>
> x := 0. [x >= 0] whileTrue: [x := x +1. Transcript show: 'infinite loop ',
> x; cr]
>
> The the interrupt key (Alt- or Cmd-) does not work, instead I have to
> force quite Squeak. Is there a reliable to way to escape an endless loop?
>
>
>
>
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/beginners/attachments/20171207/fff7d3f5/attachment.html>
More information about the Beginners
mailing list