lua-users home
lua-l archive

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


On 16-08-20 07:04 AM, Soni L. wrote:
>> local len = 1
>> while (t[len] ~= nil) do
>>    len = len + 1
>> end
>> return len
>>
> You should probably return len - 1. Otherwise {} has len 1 and {1} has
> len 2.
You're right.

> Tables shall be k/v pairs. The concept of an "array" shall be userland.
They already are.

So if I understand right you offer just drop part of existing
functionality for the sake of conceptual clearness. I think this
decision is hard to accept for many users.