in reply to Perl6 MetaModel

Greetings mkirank,
In MetaModel.pm at the beginning there is an import function wherein the following subs are put in the name space

It should be noted that these functions (class, role) are merely for helper functions, and will not be part of the eventual Perl 6 metamodel. They exist mostly to make class and role composition easier during testing. As for the (_ and __) functions, those are to make class attribute access easier, so you can say _('$.foo') which will eventually become just $.foo in Perl 6.

when the Object module is loaded the sub class in the Metamodel is called.

Yes, this is because Object (the base Object class in the Perl 6 OO system) is now defined purely by the meta-model itself. The other classes in the MetaModel folder are the "meta" level components, while the Object is a "user" level component.

Of course the lines between "user" and "meta" are blurred because Perl 6 is a highly reflective OO language, and you will have access to the "meta" level at all times.

What happens when the below code is executed ?

The $name and $params are passed to Perl6::Class->new(), which then composes the Perl6::MetaClass for that given class, and sets up the new class within the runtime environment. It might be useful to think of the class model like this:

how do those subs with "DUMMY" get created

This is just the way Data::Dumper represents the internals of a sub. I have nothing to do with it :)

I apologize for the lack of documentation in these packages right now. I did not want to write too much until I felt the design was more finalized. I might try to write something this week if I have time.

You might also find the Javascript and Java versions interesting and/or informative. The Javascript version is mostly complete, except for Roles and class attributes, while the Java version is much less complete.

-stvn

Replies are listed 'Best First'.
Re^2: Perl6 MetaModel
by mkirank (Chaplain) on Jul 26, 2005 at 10:38 UTC
    Thanks stvn :-) ... This clears some things up ...what sort of documentation were you thinking of , since i am going through this , I would be able to help on that front ..
    -Kiran
      what sort of documentation were you thinking of , since i am going through this , I would be able to help on that front

      I wanted to document the individual methods for each class, and then have one "design" document about how they all interact. Any help is very much appreciated. If you have a pugs committer bit, you can just start writing.

      -stvn