[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: boolean operators
- From: Philippe Lhoste <PhiLho@...>
- Date: Thu, 21 Sep 2006 15:03:49 +0200
Roberto Ierusalimschy a écrit :
Sam Roberts wrote:
Other than lua doesn't have the C boolean operators (&&, ||, !), which
I keep forgetting [...]
May I ask you (and others) why you need boolean operators in Lua? (This
is not a rhetorical question. I really want to know what uses boolean
operators may have in Lua.)
I believe I wrote about them recently.
I meant *bitwise* boolean operators, not *logical* boolean operators.
I don't miss the || && !, I am happy with or and not, not as verbose as
some people think, and clearer to newbies.
But I miss the | & ^ << >>
I am aware of limitations with a native float number type, but I find
them easier to use than functions calls.
They are necessary to implement some algorithms (OK, better do them in
C, but sometime I like to use only the native interpreter).
And when calling some external functions (DLL, WinAPI), either via FFI
or appropriate wrapper, we sometime need to combine options (Windows
styles, for example).
Of course, if there is "an appropriate wrapper", it could accept a table
of options instead, or some other Lua-like solution, but habits can be
hard to break... :-)
-- (near) Paris -- France
-- -- -- -- -- -- -- -- -- -- -- -- -- --