overriding invoke from PIR

NotFound julian.notfound at gmail.com
Thu Nov 12 00:38:06 UTC 2009


> Looking at three examples here, where bar is an Object, and foo is a
> custom method PMC:
>
> 1) foo("x")
> 2) bar.foo("x")
> 3) foo.invoke("x")

> 1) myself = null, mysub = foo

I don''t think that is a desirable way. If I override invoke in the
foo class to be used as in 1) I don't care about the ".sub invoke
:vtable" by himself, I'm writing a functor, function object or
whatever you prefer to call it, and the instance of that object is the
only self I care for.

Forget the invoke override for a moment and take foo as a Sub object.
A plain Sub has no special arrangements to be used that way, you must
use a pir :method modifier or other arrangements to have a sub usable
as method. So I think whatever are the plans to use a invoke override
as a method they must not interfere with his usage as a sub.

-- 
Salu2


More information about the parrot-dev mailing list