[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to make ROMable Lua data
- From: "Juris Kalnins" <juris@...>
- Date: Tue, 13 Jan 2009 12:35:15 +0200
On Tue, 13 Jan 2009 12:03:12 +0200, Bogdan Marinescu <bogdan.marinescu@gmail.com> wrote:
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),
sorry, my error. Replace those two lines with:
lua_remove(L, 1);
return ((lua_CFunction) p)(L);
that's what happens when typing from memory... :(
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.
exactly. Calling CFunction pointers directly. My error in lightCall.