lua-users home
lua-l archive

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


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/07/2013 12:13, Luiz Henrique de Figueiredo wrote:
>> Regarding numbers as table indexes in Lua 5.3, is assigning to
>> t[1.0] equivalent to assigning to t[1]?
> 
> Yes. The main point is that if x==y then t[x]==t[y]. And 1==1.0, as
> expected.
> 
Should that be "if rawequal(x,y) and rawequal(t[x],t[x]) then
rawequal(t[x],t[y])"?
i.e. table lookup does not invoke __eq metamethods does it?  Also
table values can be NaN (but keys cannot.)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.18 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJR2VmeAAoJEHp3pOlF38H/ckYIAJl3Uzuq0Ru7M3+snYKGj8El
EuXqyZ0A+G6xgNzbXjGPhodEHu4rr/OoGG1eHUrVMW70z9JjAjWECV9r6BEZ1nd1
iIg0G+jJoW3Ez6z1zdxMHW6uqKBsPjxJj1U2rUE2Koi0Om3ke6hdH28Nk7SXDWu5
gtgNnBTAqa0xXWCviYgThTdMBSZsgwwSEaH3vwtH9xgI6v4bgr3tI4kFPz30+ZRl
Q9sWvN9HEZ16c21sz1PPuMx8cdxQmCevKQQnktsdScOjwdr0G4BtVONkstkX4I4i
25vOecLXAit0CLQZgQXQKDXiw7wk3b8HilG5AR2xGPXkcWcQhbsZKogmZjH/ZUQ=
=FduY
-----END PGP SIGNATURE-----