lua-users home
lua-l archive

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


Francesco Abbate wrote:
> The problem here is that a 64bit number is not accepted by the for
> loop. I've read the LuaJIT2 documentation and Mike mentions that in
> some cases a tonumber() call may be necessary to convert the 64bit
> number to a regular Lua number.
> 
> The problem is that if I do that I will uglify my code with a lot of
> tonumber() that are also strictly useless on x86 platform.

There are many more places that don't accept 64 bit numbers. And
for most of them, there's no single best way to handle this (e.g.
for C functions bound via the classic Lua/C API). The 'for' loop
handling is already quite complicated internally and I don't want
to add more complexity.

Oh, and: the JIT compiler happily optimizes tonumber(number) away.

--Mike