How to inject methods

Andrew Whitworth wknight8111 at gmail.com
Mon Jun 28 17:52:43 UTC 2010


I'm running into a problem in Kakapo caused by the TT #389 changes.
Kakapo defines a number of extension methods for built-in PMC types
and injects those methods into the respective classes/pmcproxies.
However, this mechanism is significantly harder after the TT #389
fixes and in some cases I haven't found any way to do the things that
I need.

I would like to try and fix some of the things that I think are
broken, and add some new functionality to replace the things that we
lost in the TT #389 fix. I've been looking around and I can't really
find good rationale for the change. The comments in the Trac ticket
(and in the old RT ticket) don't really explain why the change was
needed or what problems it intended to solve. If I try to add new
functionality for what Kakapo needs, I want to make sure that I am not
breaking something that people are relying on. Can somebody give me a
rundown of what, exactly, TT #389 was supposed to accomplish?

Is the issue that it's absolutely terrible design to have the methods
available from the namespace in any way, or that methods shouldn't get
mixed in with other types of objects that the namespace stores?
Having the methods stored in the namespace now but not being able to
access them is pretty weak, especially when there are many reasons why
we would want to be able to access them there.

--Andrew Whitworth


More information about the parrot-dev mailing list