On 8/16/06, Larry Wall <[EMAIL PROTECTED]> wrote:
: Is the output 01234 or 12345?
I'd say 01234 on the theory that the 3-arg loop is really saying:
$n = 0;
while $n < 5 {
NEXT { ++$n }
NEXT { print $n }
}
and also on the theory that block exiting blocks always run in reverse order.
Wasn't NEXT supposed to do something tricky, such as being mutually
exclusive with LAST? I remember a debate some time ago where some
complained "but that would be hard to implement", and the solution
being mostly correct but failing in this case.
I seem to recall NEXT being created in order to do things like this:
for @objs {
.print;
NEXT { print ", " }
LAST { print "\n" }
}
We also might consider using perl6's hypothetical features to
implement NEXT correctly in all cases (except for those cases where
the loop update condition cannot be hypotheticalized).
Luke