[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: C API question
- From: GrayFace <sergroj@...>
- Date: Fri, 07 Jan 2011 13:07:09 +0600
On 07.01.2011 3:52, joao lobato wrote:
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.
Sergey Rozhenko mailto:firstname.lastname@example.org