On Mon, Mar 09, 2009 at 02:43:40AM -0700, Carl Mäsak wrote: > <moritz_> rakudo: my $x = { $_*2 }; say $x.arity > <p6eval> rakudo 8bbc31: OUTPUT«0» > <moritz_> that however is wrong > * masak submits > > Expected result: 1. I'm not sure what it takes for a block to > "recognize" that it has a $_ as an implicit parameter, though.
S06 says that ".arity" returns the number of required parameters. Since implicit $_ in a bare block isn't a required parameter, it's not counted in ".arity". See also http://irclog.perlgeek.de/perl6/2008-08-04#i_422497, where it says that blocks are equivalent to: <-> $_ = OUTER::<$_> { ... } S04 appears to be inconsistent with this in various places -- in a few places S04 indicates that a block is equivalent to "-> $_ { ... }" . I'm guessing those instances are places where the spec hasn't been updated. Either that or I'm missing some underlying fact that makes the spec consistent with what's been discussed over the past few months on #perl6. Rejecting ticket, Pm