lua-users home
lua-l archive

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


> How to comprehend "due to the way that Lua implements tables, the
> order that elements appear in a traversal is undefined".

Abstractly, a Lua table is a *set* of key-value pairs and the elements
of a set have no intrinsic order.

Concretely, a Lua table is implemented (at least in part) as a hash
table and the entries in a hash table might not have a fixed order
(for instance, an implementation might move the most recent accessed
entry in a collision list to the front of the list).