[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to make ROMable Lua data
- From: "Bogdan Marinescu" <bogdan.marinescu@...>
- Date: Tue, 13 Jan 2009 13:08:04 +0200
It seems that I was wrong about this, and you do receive the
lightuserdata in lightCall (I didn't know that), so yes, that would
work after all.
Best,
Bogdan
On Tue, Jan 13, 2009 at 12:57 PM, Bogdan Marinescu
<bogdan.marinescu@gmail.com> wrote:
>> sorry, my error. Replace those two lines with:
>>
>> lua_remove(L, 1);
>> return ((lua_CFunction) p)(L);
>>
>
> I understand, but at this point you have an even bigger problem :)
> lightuserdatas have a "global" metatable, just like strings and other
> elementary types (only "full" userdatas can get per-instance
> metatables). So your lightCall function will be called for all your
> lightuserdata. And from what I can tell the lightCall function doesn't
> get the function name as a parameter, so you won't know what's the
> actual function that you need to call.
>
> Best,
> Bogdan
>
- References:
- How to make ROMable Lua data, Juris Kalnins
- Re: How to make ROMable Lua data, Patrick Donnelly
- Re: How to make ROMable Lua data, Juris Kalnins
- Re: How to make ROMable Lua data, Bogdan Marinescu
- Re: How to make ROMable Lua data, Juris Kalnins
- Re: How to make ROMable Lua data, Bogdan Marinescu
- Re: How to make ROMable Lua data, Juris Kalnins
- Re: How to make ROMable Lua data, Bogdan Marinescu
- Re: How to make ROMable Lua data, Juris Kalnins
- Re: How to make ROMable Lua data, Bogdan Marinescu