[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.3.0 (work1) now available
- From: Roberto Ierusalimschy <roberto@...>
- Date: Sun, 7 Jul 2013 18:43:19 -0300
> What representation will be returned by pairs() and ipairs()? If I
> assign to t[1.0] may I then expect pairs() and ipairs() to return
> that key as a float? If I then assign to t[1], will subsequent
> calls to pairs() and ipairs() return that key as a float or an
> integer?
No matter how they are inserted, pairs and next allways return the
integer representation. (ipairs too, but ipairs does not get the keys
from the table; it produces the keys, so they are integers independently
of the table behavior.)
(This should be in the documentation, but I am afraid it is not...)
-- Roberto