|
A boolean is a logical type with a value of true or false. It may internally be represented as a single bit, but that is an implementation detail. Bitwise inversion (a more accurate name for bitwise NOT) does not apply to booleans, any more than it applies to hats. C and its various offspring frequently allow an integer value to be INTERPRETED in a boolean manner (using the zero vs non-zero convention). For this reason, in this class of language, it is valid to use boolean operators on integers (though with caution), since the integer type is overloaded. This is not the case for Lua, so your assertion is incorrect. —Tim |