lua-users home
lua-l archive

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


2018-06-04 15:17 GMT+02:00 Roberto Ierusalimschy <roberto@inf.puc-rio.br>:
>> A change that might be possible in a minor release is to make
>> `x[nil]` mean "the length of the table literal from which `x` was
>> constructed, if still known".
>
> With the "if still known" as part of the specification, Lua already
> does that:
>
>   a = {1, 2, 3}
>   print(a[nil])  --> nil   (meaning, "original length not known anymore" :-)
>
> That satisfies your especification, does it not?

In other words, the specification is already a valid model for Lua does :-)

The definition of "known" is a mere implementation detail.