[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: [Bug] Wording
- From: "Soni L." <fakedme@...>
- Date: Tue, 2 May 2017 20:01:42 -0300
The manual says "The type table implements associative arrays, that is,
arrays that can be indexed not only with numbers, but with any Lua value
except nil and NaN."
I believe this would be better worded as "The type table implements
associative arrays, that is, arrays that can have as indices not only
numbers, but any Lua value except nil and NaN."
The truth is, v=t[nil] and t[nil]=v both are valid Lua code, except the
latter errors because *a nil index cannot exist*. More specifically, you
cannot *create* a nil index, but you can check for its existence. Same
This wording more accurately represents the reference implementation,
and I believe this is intended behaviour.
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.