<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><div id="bloop_customfont" style="margin: 0px;">I’d like to throw an idea in the room and see where this will go.</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">What if Swift would allow us to create custom infix functions?</div><div id="bloop_customfont" style="margin: 0px;">Does Swift need to ability of infix functions? </div><div id="bloop_customfont" style="margin: 0px;">How powerful can such a feature be?</div><div id="bloop_customfont" style="margin: 0px;">Pros and cons?</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">There is a discussion about the `with` statement which we could develop with infix functions like so:</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">infix func with<T: AnyObject>(lhs: T, rhs: @noescape (T) -> Void) {</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;"><span class="Apple-tab-span" style="white-space:pre">        </span>rhs(lhs)</div><div id="bloop_customfont" style="margin: 0px;">}</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">class A {</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;"><span class="Apple-tab-span" style="white-space:pre">        </span>func foo() {}</div><div id="bloop_customfont" style="margin: 0px;">}</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">let instance: A = A() with { </div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;"><span class="Apple-tab-span" style="white-space:pre">        </span>$0.foo()</div><div id="bloop_customfont" style="margin: 0px;">}</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">So what does the Swift community think about that idea?</div><div><br></div></div><div id="bloop_sign_1461351716556248064" class="bloop_sign"><div>-- <br>Adrian Zubarev</div></div></body></html>