<div dir="ltr">Thank you Brent!<div>I forgot about the cases you described, where use of `->`, `!` or `?` cannot be expressed as operator functions.<br></div><div>The question is closed now, I guess.</div><div><br></div><div>- Anton</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-04-11 9:03 GMT+03:00 Brent Royal-Gordon <span dir="ltr"><<a href="mailto:brent@architechies.com" target="_blank">brent@architechies.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> `->`, `?` and `!` are used in types, but they are mostly unambiguous in expressions.<br>
<br>
</span>Sure, but types can appear in the middle of expressions. If we drop the `.self` requirement, a type name will *be* an expression. I don't think you can just ignore type names.<br>
<span class=""><br>
> The only use of `!` in expressions can be rewitten as a built-in operator function:<br>
> postfix func ! <T> (left: T!) -> T<br>
<br>
</span>This doesn't work because you can assign through an `!`. For instance:<br>
<br>
numberDictionary[key]! += 1<br>
<br>
Once we have inout return values, we might be able to make `!` a normal postfix operator. (Actually, the same goes for `&`, which just becomes a way to leverage the implicit `&`ing of operator arguments into an explicit `&`ing.)<br>
<span class=""><br>
> `?` is used in optional method calls:<br>
> a.method?(b)<br>
> A parallel proposal is going to remove such syntax from Swift, so this will not be a problem.<br>
<br>
<br>
</span>`?` is used for a lot more than that in expressions: optional chaining, the ternary operator, etc. None of them can be expressed as ordinary operators without significantly expanding operator syntax.<br>
<br>
Sorry, I don't think we can make any real progress in this space without additional language features.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Brent Royal-Gordon<br>
Architechies<br>
<br>
</font></span></blockquote></div><br></div>