Sam Ruby <[EMAIL PROTECTED]> wrote:
[EMAIL PROTECTED] wrote:
+ else if (p->vtable->base_type == enum_class_NCI) {
It was requested[1] that I not add any Python specific methods to the NCI method... accordingly, the majority of Python methods are morphed to a PyNCI class which subclasses the base NCI class.
Well, I know that the above test isn't quite right. It should be:
if (VTABLE_isa(INTERP, p, CONST_STRING(INTERP, "NCI")))
But that needs still more work - better PMC class inheritance in that case. I've proposed to add an "mro" array to PMCs to simplify inheritance checks.
[ for now, I've put in above line - should work ]
But then you effectively morph the resulting bound method into a NCI instead of a PyNCI with the following line of code:
bound_meth->vtable = Parrot_base_vtables[enum_class_Bound_NCI];
Delegation is more appropriate in this instance, and would be able to handle both NCIs and PIR methods with equal ease.
- Sam Ruby