lua-users home
lua-l archive

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


On Tue, Dec 10, 2013 at 4:48 PM, Tom N Harris <telliamed@whoopdedo.org> wrote:

If you have a lot
of them and want to use an automated API generator, building Lua tables ahead
of time will make your code look cleaner. Just have `reg_lut` return the
getter and setter table on the Lua stack then push each closure taking the
upvalue instead of reading the registry.


What I ended up doing, is having reg_lut take the indices of the getter and setter tables, fill them, and then pushed them as upvalues, avoiding the registry as you said. So I'm happy with the code now. Thanks.