lua-users home
lua-l archive

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

On 09/07/2013 19.01, Roberto Ierusalimschy wrote:
We are considering adding bitwise operations to Lua. After all, the main
reason Lua did not have them was that they were awkward as primitive
operations over floating-point numbers. With integer numbers, this
problem is gone.

Do you mean a full set of operators like in C with direct support from the VM, or just a generic width-independent bit library using usual functional syntax?

If one would ensure portability of Lua code a
mechanism should be provided for a Lua script to query the
interpreter about the current int width, [...]

try this:

print(debug.numbits'i', debug.numbits'f')


Are you considering adding access to other compile-time constants through the debug library? I'm thinking of max stack size or max recursion depth (and similar), that may be useful at run-time to avoid triggering an error by incurring in an error by exceeding them.

-- Roberto

-- Lorenzo
()  ascii ribbon campaign - against html e-mail
/\   - against proprietary attachments