lua-users home
lua-l archive

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


> It is not an "anti-value" but the default value.

Not quite, as Wladimir showed nil is currnelty a bit more special than
just a default value. A table.remove() might or might not stop on a
nil value (internally if it is in the array part or the hash part).

b = {}
b[1] = 1
b[2] = 2
b[3] = 3
b[6] = 6
table.remove(b,1)
for k,v in pairs(b) do print(k,v) end
1       2
2       3
6       6