lua-users home
lua-l archive

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


Am 08.12.2012 um 12:34 schrieb Luiz Henrique de Figueiredo:

>> I found the luaL_newlibtable & luaL_newlib in both ways it creates a new table.
>> If I use it with equal data two times, overwrite the call the existing table?
> 
> No, they create a new table every time they're called.

If I understand the documentation correct, the library name is a "global" name of the table, like
a key-value pair. IMHO in Lua the key is a unique value, so a table with a global name exists
only once. If I call the register function n-time (n > 1) it must be replace the table or ignore the
new table, because there can not exists to tables with equal names.

So in this case it can not be created a new table with an equal name.

Phil