lua-users home
lua-l archive

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


On Monday 21 June 2004 01:44, Jeff wrote:

> but about the only thing I ever find myself "wanting" is bitwise
> operations and hex literals.

Yep, same here.

I have a patch for the hexadecimal stuff - number and string literals. I 
haven't yet modified the core to add bitwise operations (&, |, ^), though I 
have a module that will do it for arbitrary strings of bits (using +, * and 
^, plus unary -). There's also bit.band(), etc., in Reuben Thomas's library. 
But it would be so much nicer for the core to support it.

I think a lot of the problem comes from the single Lua numeric type, which is 
usually a double. Lua is simple, and keeping it simple is one of the chores 
of the community. So we may be stuck with patches for our special purpose 
needs, no matter how general we may think they are.

Let me know if you ever add bitwise operators to the core, and I'll do the 
same.

Doug

-- 
--__-__-____------_--_-_-_-___-___-____-_--_-___--____
Doug Rogers - ICI - V:703.893.2007x220 www.innocon.com
-_-_--_------____-_-_-___-_--___-_-___-_-_---_--_-__-_