Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How handle the next parameter of invoke method in a PMC ?

0 views
Skip to first unread message

François PERRAD

unread,
Jan 22, 2007, 2:20:11 AM1/22/07
to parrot-...@perl.org

In Lua, a metamethod '__call' is needed.
So in the base PMC, I want write something like this:

void* invoke(void* next) {
PMC *meth = find_meth(INTERP, SELF, "__call");
/*
* Here, I need to insert SELF as first argument,
* in the argument list carried by next structure.
*/
next = VTABLE_invoke(INTERP, meth, next);
/*
* Here, if the result list carried by next is null,
* I need to insert default value : an LuaNil PMC.
*/
return next;
}

The real code is in languages/lua/pmc/luaany.pmc.
2 TODO tests are ready in languages/lua/t/metatable.t.

Thanks.

François.


0 new messages