[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.2.0 (work1) now available
- From: Duboucher Thomas <thomas@...>
- Date: Mon, 11 Jan 2010 21:33:48 +0100
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Roberto Ierusalimschy a écrit :
>> Er why? Surely the straightforward code is better in every respect?
>>
>> [...]
>> + int t1 = ttype(p1);
>> + int t2 = ttype(p2);
>> + if (t1 == t2)
>> + luaG_runerror(L, "attempt to compare two %s values", luaT_typenames[t1]);
>> [...]
>
> Light userdata and full userdata are different types but have the same name.
>
> -- Roberto
>
Ok, I have a uglier dirty hack in mind! Why not casting the two first
char of the typename into a short. You get a unique number representing
each type without having to use string comparison. ;)
Thomas.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAktLiywACgkQBV7eXqefhqiNtQCff4XKgmMhZrX66XbB1ZGa4b6H
2y0Ani8k1ynZ9+Yl0HY2eh98ONJLeZkm
=3Ot1
-----END PGP SIGNATURE-----
- References:
- Re: [ANN] Lua 5.2.0 (work1) now available, Alexander Gladysh
- Re: [ANN] Lua 5.2.0 (work1) now available, Ignacio Burgueño
- Re: [ANN] Lua 5.2.0 (work1) now available, steve donovan
- Re: [ANN] Lua 5.2.0 (work1) now available, Alexander Gladysh
- Re: [ANN] Lua 5.2.0 (work1) now available, steve donovan
- Re: [ANN] Lua 5.2.0 (work1) now available, Tom N Harris
- Re: [ANN] Lua 5.2.0 (work1) now available, Nevin Flanagan
- Re: [ANN] Lua 5.2.0 (work1) now available, Tom N Harris
- Re: [ANN] Lua 5.2.0 (work1) now available, Roberto Ierusalimschy
- Re: [ANN] Lua 5.2.0 (work1) now available, Tony Finch
- Re: [ANN] Lua 5.2.0 (work1) now available, Roberto Ierusalimschy