lua-users home
lua-l archive

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


On Mon, Apr 8, 2013 at 2:25 PM, Romeu Braz Pereira Gomes Filho <bpgomes55@gmail.com> wrote:
Is this an expected result or a bug?

Programming in Lua, Second Edition (p.16) states:

When the array has holes — nil elements inside it — the length operator may assume any of these nil elements as the end marker. Of course, this unpredictability is hardly what you want. Therefore, you should avoid using the length operator on arrays that may contain holes.