<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">Le 10 avr. 2016 à 15:01, Антон Жилин via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> a écrit :</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:13.6px;padding:0.2em 0px;margin:0px;border-radius:3px;color:rgb(51,51,51);background-color:rgba(0,0,0,0.0392157)" class="">&</code><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;line-height:25.6px" class=""> (as a prefix operator), </span><code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:13.6px;padding:0.2em 0px;margin:0px;border-radius:3px;color:rgb(51,51,51);background-color:rgba(0,0,0,0.0392157)" class="">-></code><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;line-height:25.6px" class="">, </span><code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:13.6px;padding:0.2em 0px;margin:0px;border-radius:3px;color:rgb(51,51,51);background-color:rgba(0,0,0,0.0392157)" class="">?</code><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;line-height:25.6px" class="">, and </span><code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:13.6px;padding:0.2em 0px;margin:0px;border-radius:3px;color:rgb(51,51,51);background-color:rgba(0,0,0,0.0392157)" class="">!</code><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;line-height:25.6px" class=""> (as a postfix operator)</span><br class=""><div class=""><br class=""></div><div class="">This is the list of built-ins that look like operators, but are banned from use as Swift custom operators.</div><div class=""><br class=""></div><div class="">We can review that list.</div><div class=""><br class=""></div><div class="">`&` reserved as a prefix operators for a reason. It marks a variable use as `inout`, which currently cannot be done by any Swift operator function.</div><div class=""><br class=""></div><div class="">Other three don't have such justification.</div><div class=""><br class=""></div><div class="">`->`, `?` and `!` are used in types, but they are mostly unambiguous in expressions.</div><div class=""><br class=""></div><div class="">The only use of `!` in expressions can be rewitten as a built-in operator function:</div><div class="">postfix func ! <T> (left: T!) -> T</div><div class=""><br class=""></div><div class="">`?` is used in optional method calls:</div><div class="">a.method?(b)</div><div class="">A parallel proposal is going to remove such syntax from Swift, so this will not be a problem.</div><div class=""><br class=""></div><div class="">`?` is also used in patterns:</div><div class="">if case x? = optional { ... }</div><div class=""><br class=""></div></div></div></blockquote><div><br class=""></div><div>While the use is unambiguous for the compiler, I’m not sure it’s going to be unambiguous for code readers. Having the same operator meaning different things depending the context is a bad idea IMHO.</div></div><br class=""></body></html>