So, I know how to use find_method to get a method from an object; but is there any way to dynamically add a method to a class? Basically, I want to do something like this:
newclass P2, "Foo"
new P1, P2
addr I0, _Foo::somemethod
setmethod P1, "somemethod", I0
findmethod P0, P1, "somemethod"
invoke
So, how do I do it? :) The only way I could figure out that might work was to make my own pmc class that held an alias to the class pmc itself as a property, and then treat the class itself as hash; however that seems extremely hackish, as well as pretty slow, as it would take an extra lookup to find the method. Any tips would be greatly appreciated.
- Joe