lua-users home
lua-l archive

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


Run this for some strange results:

According to the Lua reference manual, the length operator (#) is supposed to return the highest consecutive numerical index. This means the above code SHOULD return 2, because 3 is nil.

It returns 128.

The bug only worked for me if I defined the entire table manually, and it only occurred if each index is twice as large as the one before it. The values didn't matter.