[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Uniqueness of `next`
- From: Florian Weimer <fw@...>
- Date: Sun, 15 Jan 2012 19:22:41 +0100
* Dirk Laurie:
> If A and B are tables with exactly the same set of keys,
> must`next(A,k)` and `next(B,k)` always give the same first return
> value?
No, this isn't even true for Lua 5.1:
local N = 6
local t1 = {}
for i = N/2, N do
t1[i] = true
end
local t2 = {}
for i = N, N/2, -1 do
t2[i] = true
end
print(next(t1, nil))
print(next(t2, nil))
(Suitable choices for N may be architecture-dependent.)