lua-users home
lua-l archive

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


>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