Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

autrijus (1505)

  (email not shown publicly)

Journal of autrijus (1505)

Wednesday September 21, 2005
12:47 PM

Day 227: I survived!

[ #26817 ]
Wow, I'm still alive after this tumulous week, which featured not one but three met-at-the-final-minute deadlines, a rescheduled and forced-upgraded plane ticket, my passport stuck in limbo for three days due to DHL system errors, and of course even more hardware failures.

At long last I'll be able to catch some sleep now, wake up and board the plane, step off it and sleep for a few hours, then immediately step up to speak in CUFP, with nary a page of slides in sight (or in mind). Wish me luck, as I'd need it very much...

Perl6-MetaModel News

Some re-arranging has been done, ::Object now shares with ::Package and ::Module, while ::Role has been moved to the new file. This means that is concerned simply with bootstrapping things, and nothing more.

The Role work is progressing slowly becuase of $work. However, we have added pictures (p6_role_model.jpg) and there is some general thoughts/comments in as to how the bootstrapping will actually work.

We recently added a test which implements the inside-out style of objects within the meta-model. This basically shows that the meta model is capable of itself hosting other models.

Basic support (read: very experimental) for parameterized classes has been added recently. This is implemented entirely on the "macro" level, and not actually part of the meta-model itself. Here is an example of how it is used:

my $Scalar = class 'Scalar' => [ '::T' ] => sub {
    my %params = @_;
    my $T = $params{'::T'};

    $::CLASS->add_method('STORE' => ::make_method(sub {
        my ($self, $value) = @_;
        $value->isa($T->name) or die "Incorrect Type";
        # ... store the value here

At this point $Scalar is not actually a Class instance, but more a Class instance factory (actually it's a CODE ref). Here is how it is used:

my $Int = class 'Int' => {};
my $ScalarInt = $Scalar->('::T' => $Int)

Now $ScalarInt is actually an instance of Class parameterized to only accept Int objects. For a working version of this example see 32_parameterized_classes.t.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Is the check for the type actually an isa() check or is it a does() check? I think it should be the latter, but I don't know if you're that far in the code yet or if anyone's banged his shoe on the desk and said "Allomorphism matters!"

    *bang* *bang*

    • Ouch! stop hitting me with the shoe!

      Actually that check really should be (and eventually will be) a does(), however at the time of that writing Roles were not yet complete enough to be used in that manner.

      - Stevan