lua-users home
lua-l archive

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




Joseph,

1. Handcraft some Lua bytecode to create a function that uses NEWTABLE
to do what you want
2. Create a C library that you can "require" that trivially wraps
lua_createtable

Thank you very much! this is absolutely fine for me. 

I was even thinking about tweaking the ltablib.c to add table.create(): 
it should call first luaH_new() to create the table object, 
and then luaH_resize() from ltable.c.

It feels easy to manage the Lua codebase and this is a big plus from my point of view.

I guess the reason why table.create() is not there yet, is because it is slightly technical. 
Everything is managed automatically behind the scene in Lua (array/hash, int/doubles).
The average user will probably not know how to use this table.create() function or he may choose wrong parameters (causing excessive memory allocation).

Thank you very much for the help of all of you.

    Andrea


--
Andrea Vitali