# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #69312]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=69312 >


<masak> rakudo: sub foo { say "=" x 40 }; for reverse ^40 -> $n {
&foo.wrap({ say "=" x $n; callsame; say "=" x $n }); }; foo
<p6eval> rakudo 0eaf62:
         
OUTPUT«␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤========================================␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤»
<masak> in the above code, why doesn't $n bind like I think it should?
<masak> I had hoped it would produce a nice triangle of ='s.
<pmurias> rakudo: sub foo { say 40 }; for reverse ^40 -> $n { say
$n;&foo.wrap({ say
          $n;  callsame; say $n }); }; foo
<p6eval> rakudo 0eaf62:
         
OUTPUT«39␤38␤37␤36␤35␤34␤33␤32␤31␤30␤29␤28␤27␤26␤25␤24␤23␤22␤21␤20␤19␤18␤17␤16␤15␤14␤13␤12␤11␤10␤9␤8␤7␤6␤5␤4␤3␤2␤1␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤40␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0
<pmurias> masak: looks like some sort of a scoping bug
* masak submits rakudobug

I'm not certain this is a bug. But if Perl 6 doesn't conform to my
expectations in the above case, it'll be interesting to learn why not.

Reply via email to