lua-users home
lua-l archive

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


In Lua 5.1 w1 script

-- CUT HERE 
local t = {nil, 1}
print (table.getn(t))
local t = {1, nil}
print (table.getn(t))
local t = {1, 2, nil, 3}
print (table.getn(t))
local t = {1, 2, 3, nil}
print (table.getn(t))
local t = {1, 2, 3, nil, 4}
print (table.getn(t))
local t = {1, 2, 3, 4, nil, 5}
print (table.getn(t))
-- CUT HERE

Output 
2
1
4
3
3
6

It seems like nil being at and odd position is somehow has no effect.

Alex