> On Aug 31, 2017, at 5:51 PM, André “Zephyz” Videla <[email protected]> > wrote: > > That is exactly what I argue should be avoided. When you see `+` you don’t > expect it to throw.
Perhaps not, but the language makes you mark the expression with `try` to make that fact clear. And your specific suggestion of `+!` is misleading—`!` usually implies something that can fail *by asserting*, which plain `+` actually *does* but a throwing `+` does not. In my view, an operator is just a funny-looking name. `+`, without any further context, does not imply an exact semantic with properties like commutativity any more than `add(_:)` does. I don't think anyone working on Swift seriously believes that every method name ought to be exclusively associated with one and only one protocol, so I see no reason that every operator ought to be, either. Protocols describe precise, formal semantics; operators describe general kinds of operations. Let protocols be protocols and operators be operators. -- Brent Royal-Gordon Architechies
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
