This is something that has already been discussed. It's also in the list of Commonly Rejected Changes:
Replace logical operators (
&&
,||
,!
, etc.) with words like "and", "or", "not", and allow non-punctuation operators and infix functions: The operator and identifier grammars are intentionally partitioned in Swift, which is a key part of how user-defined overloaded operators are supported. Requiring the compiler to see the "operator" declaration to know how to parse a file would break the ability to be able to parse a Swift file without parsing all of its imports. This has a major negative effect on tooling support. While not needing infix support,not
would need operator or keyword status to omit the parentheses as!
can, andnot somePredicate()
visually binds too loosely compared to!somePredicate()
.