lua-users home
lua-l archive

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


> On Jun 4, 2015, at 3:38 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 
> In Lua 5.3, when a key is equal to an integer, it is converted to an integer.
> This is not an implementation detail, but is documented in §2.1 of the manual.
> 
>    To avoid ambiguities, any float with integral value used as a key
> is converted
>    to its respective integer.
> 
> In the light of this fact, is there a good reason why the definition
> of a sequence
> says "the set of its positive numerical keys is equal to {1..n} for some
> non-negative integer n" instead of "the set of its positive integer-valued keys
> is equal to {1..n} for some non-negative integer n"?
> 

I see no reason why this should change. The support for 64-bit integers doesn't change the concept, which is to disallow non-integral positive keys in a sequence. The definition deals with values (integral vs non-integral) not their representation (integer or integral float).

—Tim