lua-users home
lua-l archive

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


On 7/7/2013 4:13 AM, Luiz Henrique de Figueiredo wrote:
Yes. The main point is that if x==y then t[x]==t[y]. And 1==1.0, as expected.

It seems like there may be instances where existing code is now inadvertently inserting a mixture of floats and integers as indexes.

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?

thanks,
Scott