lua-users home
lua-l archive

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


On Wed, 3 Mar 2010, Jon Nalley wrote:

> I am having a hard time understanding why I am seeing different
> behavior in the following cases:
[snip]

> Can anyone shed some light on this for me?

The short answer is: because Lua is on crack.

The slightly longer answer is: #t is defined to return an index i of 
such that t[i] is non-nil and t[i+1] is nil, or zero if no such index 
exists.

See http://www.lua.org/manual/5.1/manual.html#2.5.5

Cheers,

Joonas