lua-users home
lua-l archive

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


On 07.01.2011 3:52, joao lobato wrote:
Hi, List

I've been toying with a simple array library using the C API.

It implements 0-based arrays and functions to get and set values. It
supports any Lua type, with nil as default value.

My question is: my arrays store references (from luaL_ref) to a single
table in the registry; should I use one table for each array? Is there
another way to store the Lua values?
Sounds messy. Storing values returned by luaL_ref is especially weird.
You can do without luaL_ref by storing values in object's metatable.

--
Best regards,
Sergey Rozhenko                 mailto:sergroj@mail.ru