lua-users home
lua-l archive

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


And sorry for the remaining typos 
* "|' instead of "[" instead the "meta:__newindex" function body, and
* missing "[]" around expressions of keys in the main table constructor.
This does not change the meaning of the message. We still need to have a defined behavior with an expected evaluation order for keys and values, and for assignments of keys in the new table.

A JIT compiler may still use either a single array for storing all keys and values or could preallocate separate arrays with known length for its keys and values, in order to build the final table with a predefined initial size (the final size of the returned table could still be smaller if there are duplicate keys or nil values assigned to them; and in my opinion the table constructor should use the indicated metatable, it may use the core "rawset(t,k,v)" function of the library directly only for simple table constructors not specifying any metatable, but it should respect the same order for assignments as if there was a metatable specified and containing a __newindex method), so that no reallocation will occur during the construction (so this would minimize the GC overhead).