Do you know where your variables are? | |
PerlMonks |
Re: Perl6 MetaModelby stvn (Monsignor) |
on Jul 25, 2005 at 14:56 UTC ( [id://477859]=note: print w/replies, xml ) | Need Help?? |
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
In Section
Seekers of Perl Wisdom
|
|