Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Perl6 MetaModel

by stvn (Monsignor)
on Jul 25, 2005 at 14:56 UTC ( [id://477859]=note: print w/replies, xml ) Need Help??


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:

  • A MetaClass has a method table, attribute descriptions and superclass list.
  • A Class has a metaclass instance.
  • An Instance has a Class pointer and local attribute storage

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://477859]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2024-04-24 10:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found