Pretty sure you get the 1 as the return value of "say" (same as in
perl5, print & say return 1 if they were able to output the entire
string, or 0 if there was an error eg. printing to a closed
filehandle). And the return value of any block is the last value of
the block. And you're calling the block because of the () after the
$x. And I'm pretty sure neither rakudo nor any other perl6
implementation implements captures very well, and there's still
discussion about how captures should work.

-y



On Tue, Sep 15, 2009 at 4:33 PM, Aaron Sherman <a...@ajs.com> wrote:
> I tried this out, and I'm not 100% certain why I got what I did (#20
> release):
>
> Code:
>
>  my $x = \(-> { say "Perl 6" }); say $x();
>
> Output:
>
>  Perl 6
>  1
>
> First off, why can I invoke a capture when it contains a lambda? Shouldn't I
> get an error, here?
>
> Second, why the 1? Is that the return value of the lambda?
>

Reply via email to