[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua's symbol table
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Sat, 4 Aug 2001 20:52:23 -0300
>This part I'm not clear on... if I do this:
>
> lua_pushstring( L, "test" );
> int ref1 = lua_ref( L, 1 );
> lua_getref( L, ref1 );
> int ref2 = lua_ref( L, 1 );
> lua_pushstring( L, "test" );
> int ref3 = lua_ref( L, 1 );
>
>Are ref1, ref2 and ref3 guaranteed to be equal? Seems like they should
>be, but it's not spelled out in the manual. That's what I need for the
>symbol-table idea to be useful.
They are all different. Each time you call lua_ref you get a different number.
If you want to map strings to anything, use a plain Lua table.
--lhf