Mark J. Reed writes:
:       <exegesis4>
:       # Perl 5 code
:           for (my $i=0; 1; $i++) {
:       
:       which would translate into Perl 6 as:
:       
:       
:       loop (my $i=0; 1; $i++) {
:       </exegesis4>
: 
: May I infer from this the return of loop-scoped variables (in
: which the loop control variable is magically inserted into the
: loop block's lexical scope, even though it's declared outside of
: the latter's curlies)?  If so, I must have missed a mind-change in
: that thread; if not, then putting the 'my' inside the parens is a
: tad misleading . . .

No, the scope of $i stays outside, per the previous decision.  If you
want it inside you can always make $i an official formal parameter:

    for 0 .. Inf -> $i { ... }

I think that better documents a counted infinite loop in any case.

Larry

Reply via email to