Module:Is sequence

--

-- Returns true if a given table is "array-like", i.e. it meets the following -- criteria: -- --    1. Each key must be a number. --    2. Each key must be one greater than the previous key. --    3. The first key must be 1. -- -- Note that an empty table is "array-like" because it has no keys. -- -- @see 

return function ( table ) local index = 1

for _ in pairs( table ) do       if table[index] == nil then return false end

index = index + 1 end

return true end

-- --