Comment Re:users? (Score -1) 311
I don't know; Lua's treatment of both as the same type of data leads to unexpected behavior:
local a = { 1, 2, 3, 4, 5 }
a[3] = nil -- "Remove" an element
-- Now a is { [1] = 1, [2] = 2, [4] = 4, [5] = 5 }
On a similar note, Lua's "everything undefined is nil" behavior can lead to subtle bugs. For example:
local a = { alpha, betaa, delta, gamma }
Assuming those are previously defined, the misspelled "beta" will evaluate to nil and create an array hole, which will screw up the value returned by the length operator. It also means you can't do things like reliably get the count of { f() } if f() returns nil.