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.