[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.2.0 (alpha-rc2) now available
- From: Nick Gammon <nick@...>
- Date: Fri, 19 Nov 2010 14:19:03 +1100
On 19/11/2010, at 2:00 PM, David Manura wrote:
> The function does seem fairly trivial to include since bit32.TEST(...)
> == (bit32.AND(...) ~= 0).
>
Trivial perhaps, but quite a few times I have fallen for this:
if bit.band (x, 0x10) then
-- blah
end -- if
This 'if' always evaluates to true, which can catch people who are used to C.
For me, the "test" function is a welcome way of avoiding this (of course, you need to remember to use it).