lua-users home
lua-l archive

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


On 30.06.2016 16:01, Andrew Starks wrote:
> On Thu, Jun 30, 2016 at 8:23 AM, Roberto Ierusalimschy
> <roberto@inf.puc-rio.br> wrote:
>>> — How should constructors set length? What are the lengths of {}, {1, 2} and {1, 2, [3]=3} ?
>> 0, 2, and 2.
>>
>> -- Roberto
>>
> Yuck. I would not want to be the one to document or defend that behavior.
>
> - Andrew Starks
>
I also wouldn't want to be the one to write the code for the third
table, at least as long as I didn't have *very* good reasons to do so...
But yes, 0, 2 and 3 would make far more sense in this case.

- Henrik Ilgen