Joe Gottman writes:
>    It would be nice if there were some easy way to mimic the Perl5 behavior
> in Perl6.  In Perl6, the canonical way to make a variable local to a block
> is by making it a parameter. I therefore suggest allowing the following
> syntax:
> 
>     loop 0 -> $n; $n < 10; ++$n {...}

That doesn't make any sense.  A nice property of -> is that it's like
"sub" without the parentheses.  So your proposal looks like:

    loop 0 sub ($n); $n < 10; ++$n {...}

Which is confusing.  I don't think we want to break the equivalence of
-> and "sub".

I'm disregarding readability problems with the C-style for "loop" these
days, since most of them can be rewritten with Perl 6's "for".  What I'm
interested in is those common things that can be expressed with "loop"
but not with "for"---where "loop" is the most readable solution.

Luke

Reply via email to