lua-users home
lua-l archive

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



On Jun 11, 2015, at 3:03 AM, Mike <lua-l@inbox.ru> wrote:

I see, it is reasoned. If we strictly follow the logic,
the length operator should ideally return nil in theese cases,
because "it usually represents the absence of a useful value".

This has been debated here many many times. The trouble is that any algorithm that can detect that a table is NOT a sequence is significantly more expensive that the current # algorithm. The Lua teams position is that in the majority of cases you would know if a table was a sequence or not and hence the extra checking would be a (significant) waste of time.

—Tim