lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> This code (see also luaT_gettmbyobj) looks up entry "__call"
> in object's metatable (which has to be a real Lua table),
> and checks that this entry is a function.
> It doesn't check type of object.
> It checks type of metamethod.

You're right, but then you're using lua_call from your __call
metamethod (lightCall), and that's the part I don't understand how
it's supposed to work. Once again, to call any function you'd need a
LUA_TFUNCTION object. One per function, to be more precise. Your
lightCall seems like it's trying to call pointers directly.