Day 67: Basic multidim support.

autrijus on 2005-04-08T20:45:59

The YAPC::NA hackathon did fill up quickly. We have 10 people now: jmm, chip, tdl, stevan, pmichaud, luqui, lwall, theorbtwo, castaway, autrijus. As there are only rooms for 3 more people, please let our host know if you'd like to go.

I've spent many hours today on various false starts regarding ITypes, trying to do clever dispatches based on Parrot's PerlArray/PerlScalar/PerlHash PMC mode. Sadly, I have come to the realization that the semantic for ITypes seems to be exactly the same as the Perl 5 model, their only difference being the possibility of multiple mix-in ITypes on the same variable, as well as the auto-referencing bit.

However, with tremendous amount of help from Stevan in forms of tests, I have at least got the value part working, so this small example from asavige runs correctly now. Yay!

Also fixed is the undef $x bug (undef was not declared as is rw), reported and tested by ninereason; he have also added various lvalue related tests.

Stevan reported that in sub foo (+$x = 3, +$y = 4), the comma is parsed as part of the default for $x. I'm not sure how to deal with it rigorously, so I have simply removed , from the parser for default parameter values.

Stevan also asked for is rw support in parameter declarations, which I promptly implemented. Now he wants is copy... Any takers?

The trailing comma (and redundant comma anywhere) is finally parsed correctly. Building on that, I have implemented this idea of Larry's:

    @a[0]  = expr();    # scalar context to expr()
    @a[0,] = expr();    # list context to expr()

Ovid suggested (and luqui confirmed) that say and print should default to $_, and I implemented as such. Shortly after, I was surprised to see that Damian updated Perl6::Say to do the same thing, which marks his first upload in a year. Welcome back, Damian!

Gruber sent in a patch to make $*PID work on *nix systems; I gladly applied it. gaal committed a few tests for the yet-unimplemented next primitive.

Two more days for Pugs work until the scheduled 6.2.0 release. Stay tuned!


Minor Correction

Limbic Region on 2005-04-09T15:43:18

CPAN uploads is one of the many places I lurk - Damian actually uploaded version 0.03 of Perl6::Say only a month ago, so he has had 2 uploads in the last year.

Cheers,
L~R