[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaJIT 64 bit integers (was: the purpose of lightuserdata)
- From: David Manura <dm.lua@...>
- Date: Wed, 12 Jan 2011 23:07:02 -0500
On Wed, Jan 12, 2011 at 8:24 PM, Mike Pall <email@example.com> wrote:
> Cdata objects are a distinct type, but treating these as unequal to
> any number or not comparable would be rather counter-intuitive:
> e.g. 1LL == 1 should really return true [...]
> But it's unclear how far one should take this.
Even `1LL == 1` may not be so clear. In code like `if b == 1 then
[...] end` written only with standard Lua in mind, it can be assumed b
is 1 inside the block, or at least that b has all the properties that
1 has. It's conceivable (however remotely) that this code may break
under the above proposal if 1LL somehow makes it into b. The
principles in  may therefore apply just as well here.
Ocaml is one example of a language where floats are heap allocated
while integers are not , and it doesn't do implicit conversions
between these two numeric types (for better or worse).
 http://lua-users.org/lists/lua-l/2010-11/msg00524.html -- "[..]
upwards-compatible 5.2 features in LuaJIT are *DISABLED* by default.
Even though they are unlikely to break anything for most people."