lua-users home
lua-l archive

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




Please, do not refer to the "array part" or the "hash part" of a table,
unless you are discussing the implementation of tables. They are
completely invisible (except for performance).

-- Roberto


I have personally replaced the Lua table implementation with an single-mechanism array-based hash table to reduce branching and memory consumption. Apart from serving as a hash table, when a table is used only as an array, the data structure will look like one automatically (a tight array of ordered numbers). Naturally, from the outside the language appears unchanged.

In this scheme, there is no "array part", and thus it is not sensible to rely on implementation-based behaviour when iterating tables.

/ Tom