lua-users home
lua-l archive

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

On 06/07/2013 22.05, Rena wrote:
But as I explained earlier, using a library won't change the fact that the
underlying data structure (the table's array part) can't store nil, thus
penalizing performance.

I suppose an array library should work like arrays in other languages: the length changes only when you add or remove elements, or when you shorten it explicitly, whatever you store into the array (nil included). That should take care of the performance hit, as there would be no need to look at the contents to determine the current array size.

(I would build such a library with a table and would not make it part of core Lua; I find the current approach much more useful and versatile)