<div dir="ltr">You can already define custom operator `<-`. I'm talking about tokens which are reserved, but look like operators. For example,<br><div>postfix operator ! { }</div><div>is an error, which seems illogical, because optional force-unwrapping totally looks like an operator.</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-04-11 0:14 GMT+03:00 <span dir="ltr"><<a href="mailto:hitstergtd+swiftevo@gmail.com" target="_blank">hitstergtd+swiftevo@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">How about "<-"?<br>
<br>
I could see a few shorthands with that for Strings, etc. :-)<br>
<br>
On 10 April 2016 at 22:03, Jean-Daniel Dupas via swift-evolution<br>
<div><div class="h5"><<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
><br>
> Le 10 avr. 2016 à 15:01, Антон Жилин via swift-evolution<br>
> <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> a écrit :<br>
><br>
> & (as a prefix operator), ->, ?, and ! (as a postfix operator)<br>
><br>
> This is the list of built-ins that look like operators, but are banned from<br>
> use as Swift custom operators.<br>
><br>
> We can review that list.<br>
><br>
> `&` reserved as a prefix operators for a reason. It marks a variable use as<br>
> `inout`, which currently cannot be done by any Swift operator function.<br>
><br>
> Other three don't have such justification.<br>
><br>
> `->`, `?` and `!` are used in types, but they are mostly unambiguous in<br>
> expressions.<br>
><br>
> The only use of `!` in expressions can be rewitten as a built-in operator<br>
> function:<br>
> postfix func ! <T> (left: T!) -> T<br>
><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<br>
> not be a problem.<br>
><br>
> `?` is also used in patterns:<br>
> if case x? = optional { ... }<br>
><br>
><br>
> While the use is unambiguous for the compiler, I’m not sure it’s going to be<br>
> unambiguous for code readers. Having the same operator meaning different<br>
> things depending the context is a bad idea IMHO.<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> swift-evolution mailing list<br>
> <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
> <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
><br>
</blockquote></div><br></div>