in reply to while () vs. while (1)
does not produce an infiinite loop, whereas:print "Here\n" while();
does, which is a bit inconsistent.while(){print "Here 2\n"}
and it did not give an infinite loop, it dropped straight through. That might be an effect of () being an empty list (false), so I tried# perl6 while () { say "Hello" }
but that would not compile. The bare loop statement is specifically for infinite loops in p6 SFAIK, butwhile {say "Hello 2"}
also works as expected.while 1 {say "Hello 2"}
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: while () vs. while (1)
by ikegami (Patriarch) on Jan 22, 2011 at 06:51 UTC | |
by tye (Sage) on Jan 23, 2011 at 06:17 UTC |