lua-users home
lua-l archive

Re: Thoughts on {...} and tbl[nil]

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


> 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

AltStyle によって変換されたページ (->オリジナル) /