Hi,

Tonight I started working on the association between classes and namespaces as specified in PDD15. Have some questions.

1) I added a "slot" to the NameSpace PMC to hold a Class or Role PMC a while back. However, there is no interface specified for storing/getting at this slot. For now I've added "set_class" and "get_class" METHODs to the NameSpace PMC. What should these actually be called (if something else)? Whatever is decided on should be added to a PDD somewhere - I guess the NameSpce PDD.

2) I see that we now just have a .name method and no .namespace method. For Class, the description of the name method says:

"The accessor for the name attribute. With no argument, it simply returns the current value for name. When passed an argument, it sets the name of the class, and also sets the association with a namespace. With no argument it only returns the current value of the name attribute."

That is a little unclear to me. What should the name slot be set to - the name of the most nested bit of the namespace (e.g. for [ "Animal" ; "Monkey" ], name is "Monkey")?

Also, what should it return? Just the name attribute? What if you really want to get at the namespace?

Finally, note that Role says something different - I guess these should be consistent?

3) For Role (but not Class - mistake?), it says:

"When you associate a class with a namespace, it pulls in all of the methods and vtable methods held within that namespace."

At the moment, we do not carry the ":method" adverb on subs through to the PBC. Thus while I guess you can iterate a namespace (not tried it yet, just assuming you can since it's derived from Hash) and test for PMCs to make sure they are Subs. However, beyond that you have no way of knowing if it's a method or not (so far as I can see, I'd love to be corrected on this if anyone knows otherwise). Should :method be carried through to a PBC level?

4) After this it says:

"And when replacing one class with another in the association, it removes any methods and vtable methods from the previous class."

Remove methods from what? The class or the namespace? If the class, does it remove all methods from the class then pull in ones from the new namespace? Or do we look at the old namespace and see what methods it has, then remove just ones that appear there?

Thanks,

Jonathan

Reply via email to