On Tue, Sep 15, 2009 at 8:18 PM, yary <not....@gmail.com> wrote: > 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).
Yeah, I should have been clearer. I was wondering what the 1 was coming from because I wasn't entirely sure that the lambda's return value should be the "value" of the capture. Your later comments about the state of captures makes all of this much clearer. Thanks. > 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? > > >