At 11:13 AM +0100 12/14/04, Leopold Toetsch wrote:
Dan Sugalski <[EMAIL PROTECTED]> wrote:

subclass - To create a subclass of a class object

Is existing and used.

Right. I was listing the things we need in the protocol. Some of them we've got, some we don't, and some of the stuff we have we probably need to toss out or redo.


> add_parent - To add a parent to the class this is invoked on
become_parent - Called on the class passed as a parameter to add_parent

What is the latter used for?

To give the newly added parent class a chance to do some setup in the child class, if there's a need for it. There probably won't be in most cases, but when mixing in classes of different families I think we're going to need this.


> class_type - returns some unique ID or other so all classes in one
class family have the same ID

What is a "class family"?

The metaclass's class. I think. This is meant to be an identifier that says what kind of class a class is, so code can make some assumptions about internal structure and such. Everything that's based on a ParrotClass PMC, for example, would have the same class_type ID.


 >      add_method - called to add a method to the class
 >      remove_method - called to remove a method from a class

These are the other two parts of the C<fetchmethod> vtable I presume. When
during packfile loading a Sub PMC constant is encountered and it's a
method, C<add_method> should be called instead of C<Parrot_store_global>?

Yeah, I think so. I'm not too happy about it, but I think that's the way things will end up. Most classes will then go and stuff the methods into the namespace, but I think it'll have to be up to the classes whether they use the namespaces for methods or not.


 >      namespace_name - returns the name of this class' namespace

Should we really separate the namespace name from the class name?

Yes. We're going to have cases where we've got multiple classes with the same name but different namespaces. (Generally classes masquerading as other classes, but I can see some other cases)


> get_anonymous_subclass - to put the object into a singleton anonymous
subclass

How is the singleton object created in the first place?

For now, I think singletons will all be objects of a normal class that get pulled into a singleton class, most likely because code's added or changed methods on the object rather than to the class.
--
Dan


--------------------------------------it's like this-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to