[swift-evolution] Remove (!) logical negation operator

Jeremy Pereira jeremy.j.pereira at googlemail.com
Wed Dec 16 08:01:14 CST 2015


> 
>> 
>> I think that the best option we have until now is "~" used for bitwise "not" operation. This bring the next question: why we need to distinguish between bitwise logical operators and boolean logical ones? Doesn't that should be implicit in the type of the operands?
> 
> I think this is a fantastic idea. Given that there is a first class boolean type in Swift and we no longer have to pretend that ints are bools, there is no reason not to use ~ for logical negation of both types. The ! and && and || operators only exist at all because C uses the same type for both bools and small arrays of bits.

Forgot about the short circuiting of && and ||. We have to keep them.




More information about the swift-evolution mailing list