[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Could somebody explain "due to the way that Lua implements tables, the order that elements appear in a traversal is undefined" in more detpth?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Sun, 11 Oct 2020 17:14:12 -0300
> 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).