[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Thoughts on {...} and tbl[nil]
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 4 Jun 2018 10:17:08 -0300
> 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?
-- Roberto