On Fri Aug 06 12:56:24 2010, moritz wrote:
> 21:53 < moritz_> rakudo: for <a b>.kv -> $k, $_ { .perl.say }
> 21:53 <+p6eval> rakudo 0e5edb: OUTPUT«0␤1␤»
> 21:53 < moritz_> huh.
> 21:54 < moritz_> shouldn't that be "a", "b" ?
> 21:54 < moritz_> rakudo: for <a b>.kv -> $k, $v { $v.perl.say }
> 21:54 <+p6eval> rakudo 0e5edb: OUTPUT«"a"␤"b"␤»
> 
> I don't see why it shouldn't work with $_ if it works with $v.


It appears to be even weirder than the above illustrates -- if a
subroutine has $_ as any of its parameters, it seems to always take the
first argument:

  pmich...@plum:~/rakudo$ ./perl6
  > sub abc($x, $y, $_, $z) { say "$x $y $_ $z"; };   abc(1,2,3,4);
  2 3 1 4

Pm

Reply via email to