<div dir="ltr">But is there anything actually wrong with the way it is today?<div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 12, 2016 at 3:22 AM, Anton Zhilin via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Why don't we go the other direction? Example:<div><br></div><div><div style="font-size:12.8px">func ^^(prefix: Int) {}</div><div style="font-size:12.8px">func ^^(postfix: Int) {}</div><span class=""><div style="font-size:12.8px">func ^^(lhs: Int, rhs: Int) {}</div></span></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">We will make 'prefix', 'postfix' and perhaps 'lhs' and 'rhs' required external parameter names for operator functions.</div><div><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2016-07-12 7:03 GMT+03:00 Jacob Bandes-Storch via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Currently, "infix" is not required/allowed on an operator function definition, but "prefix" and "postfix" are:</div><div><br></div><div><div><div> prefix operator ^^ {} // valid</div><div> postfix operator ^^ {} // valid</div><div> infix operator ^^ {} // valid</div><div><br></div><div> prefix func ^^(operand: Int) {} // valid</div><div> postfix func ^^(operand: Int) {} // valid</div><div> infix func ^^(lhs: Int, rhs: Int) {} // <b>error: </b>'infix' modifier is not required or allowed on func declarations</div><div> func ^^(lhs: Int, rhs: Int) {} // valid</div></div></div><div><br></div><div>It seems like this was removed because it can be inferred from the number of arguments (<a href="https://github.com/apple/swift/commit/3ad9c58c18f0331444114e2eae3e772e702c326f" target="_blank">https://github.com/apple/swift/commit/3ad9c58c18f0331444114e2eae3e772e702c326f</a>). But IMO the inconsistency from other operator function decls/defs is jarring.</div><div><br></div><div>How does everyone feel about reinstating the "infix" modifier on functoins? (It was removed before the open-source release and the advent of swift-evolution, so I thought it'd be worth a public review.)</div><span><font color="#888888"><br clear="all"><div><div data-smartmail="gmail_signature"><div dir="ltr"><div>Jacob</div></div></div></div></font></span></div></blockquote></div></div></div></div></div>
<br>_______________________________________________<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></div>