On Mon, Aug 18, 2008 at 05:07:23PM +0200, Moritz Lenz wrote:
> [EMAIL PROTECTED] (via RT) wrote:
> > 
> > - Need a clarification of what .perl should return here
> 
> Some discussions on if and how closures should be clonable via .perl:
> http://irclog.perlgeek.de/perl6/2008-07-31#i_417160

After researching this a bit more, I think I know what's happening
here.

The t/spec/S02-names_and_variables/perl.t file has a number of
(skipped) tests where the message reads '{...}.perl does not work'
or '{...}.perl is invalid'.  When the various skip messages were
placed into the ROADMAP document I think this got translated into
"Implement .perl on code objects".  However, the C<.perl> methods
in the test file are really being used on things built via
Hash constructors and not true closures.  For example:

    { :a(1), :b(2), :c(3) }.perl

Since Rakudo now implements the curly hash constructor (jonathan++),
the .perl method also works for these "closures":

    > say { :a(1), :b(2), :c(3) }.perl
    {"a" => 1, "b" => 2, "c" => 3}

Thus I think ".perl on code objects" is probably not what we
ultimately needed or wanted.

I'm going to mark this ticket as resolved for now, and we can
open new tickets if we determine that .perl really does need
to work on code objects.  :-)

Also, this brings up some questions regarding the tests
in S02-names_and_variables/perl.t which are probably
best resolved on p6l.

Thanks!

Pm

Reply via email to