lua-users home
lua-l archive

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

Theres any lib/package that does the binding in real time? Like just create a lua state, send to lua all stuff you want, and then runs the script...Im not interested on creating dlls, or whatever, Im interested in just linking class objects data to lua, so I can make the callbacks possible, like Kevin Martin suggested..

Looks like Luna does what I want, am I right? Any other recommendation? LuaBind looks bloated of overhead, so I discarded it..

On Mon, Oct 22, 2012 at 5:32 PM, Coda Highland <> wrote:
On Mon, Oct 22, 2012 at 11:08 AM, Kevin Martin <> wrote:
> On 22 Oct 2012, at 18:51, Coda Highland wrote:
>> Why use something as clumsy as a UUID for the key when you get a
>> unique ID back from luaL_ref?
> How can I use luaL_ref? I'm thinking to have a static function such as:
> static int foo(lua_State *l) {
>     lua_pushstring(l, "special key");
>     lua_gettable(l, LUA_REGISTRYINDEX);
>     SomeObject *o = lua_touserdata(l, -1);
>     o->bar();
>     return 0;
> }
> foo needs to know at compile time where to look to get the object (as there is no runtime data passed to foo), the returned value from luaL_ref is not known until runtime.
> Thanks,
> Kev

Ah, you want it known at compile time. That does change matters. Never
mind, then.

/s/ Adam