Allison Randal wrote:
There currently isn't any way to add vtable overrides to the class's
list of vtable overrides, so this is temporary (and actually, I
thought you put it in).
That was implemented earlier today. I wrote the email before I'd
implemented it. I think I've implemented what you meant in PDD15, but
please check.
The problem is that Object was poking directly into the internals of
Class, which definitely breaks encapsulation between the two. Object
needs a standard interface in Class that it can query for methods. It
doesn't have to be find_method.
I thought we had this discussion a while back and agreed that Object
could know about the internals of Class, because any different class
would implement and instantiate its own object anyway? In principle,
encapsulation is nice, though.
I ended up pulling the lookup code back into Object for now, because you
need to have the instances of the PMCs we are inheriting from available
during method lookup to call find_method on.
Technically we do have a way to write Object's find_method independent
of the class: use inspect_str("methods"). Problems are performance
(which is second to correct behavior, of course, but still...) and that
the values that inspect_str takes and is expected to respond to aren't
actually standardized anywhere.
Jonathan