lua-users home
lua-l archive

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


As the Lua docs state, an array is a table with a sequence of elements from 1..N.

But my question is: is it ok to build the array out of order? For example:

a = { 1, [3]=3 }
a[2]=2

Is "a" an array? Lua *seems* to think it is (#a returns 3), but the Lua docs seems to be a bit vague on this (it seems to be implied by the term "sequence" in the ref manual).

TIA,
Tim