<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;">I must correct myself, I’m a bit sleepy.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><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;">infix func with<T: AnyObject>(lhs: T, rhs: @noescape (T) -> Void) -> T {</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;"> rhs(lhs)</div><div id="bloop_customfont" style="margin: 0px;"> return 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;">This one will do the trick.</div></div> <div id="bloop_sign_1461352311047464960" class="bloop_sign"><div>-- <br>Adrian Zubarev</div></div> <br><p class="airmail_on">Am 22. April 2016 bei 21:07:00, Adrian Zubarev (<a href="mailto:adrian.zubarev@devandartist.com">adrian.zubarev@devandartist.com</a>) schrieb:</p> <blockquote type="cite" class="clean_bq"><span><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div></div><div>
<title></title>
<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;">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;">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;">$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>
</div></div></span></blockquote></body></html>