Sam Ruby <[EMAIL PROTECTED]> wrote:
It still doesn't make sense to me. Try adding the following line to both fixedpmcarray.pmc and perlint.pmc:
METHOD INTVAL inheritme() { return 42; }
Ok, that's exactly that part, which currently *is* broken. If you have some time please read src/objects.c:1237 ff. The code is unfinished and wrong: - it follows only one parent and stops then - it apperently is wrong, if there is a longer chain of parents
Shouldn't be too hard.
Patch attached.
- Sam Ruby
Index: objects.c =================================================================== RCS file: /cvs/public/parrot/src/objects.c,v retrieving revision 1.118 diff -u -r1.118 objects.c --- objects.c 22 Sep 2004 09:21:45 -0000 1.118 +++ objects.c 16 Oct 2004 12:55:11 -0000 @@ -1235,23 +1235,20 @@ * TODO check vtable standard names */ start = class_name->strlen + 1; - for (isa = class->vtable->isa_str; ;) { - if (isa->strlen <= start) - break; + isa = class->vtable->isa_str; + while (isa->strlen > start) { pos = string_str_index(interpreter, isa, CONST_STRING(interpreter, " "), start); - if (pos == -1) { - method = Parrot_find_global(interpreter, - string_substr(interpreter, isa, start, - isa->strlen - start, NULL, 0), - method_name); - TRACE_FM(interpreter, class, method_name, method); - if (method) { - return method; - } + if (pos == -1) pos=isa->strlen; + method = Parrot_find_global(interpreter, + string_substr(interpreter, isa, start, + pos - start, NULL, 0), + method_name); + TRACE_FM(interpreter, class, method_name, method); + if (method) { + return method; } - /* TODO */ - break; + start = pos + 1; } /* finally look in namespace "object" */ method = Parrot_find_global(interpreter,