<div dir="ltr">+1</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 19, 2015 at 2:30 PM, Craig Cruden 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 style="word-wrap:break-word"><div><br></div><div>When writing short functional code in a function it would be nice if the return keyword were an optional keyword. </div><div><br></div><div>Just return the last evaluated expression.</div><div><br></div><div><br></div><div>i.e.</div><div><br></div><div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> <span style="color:#bb2ca2">func</span> flipFunc<T, U>(arg1: <span style="color:#703daa">T</span>, arg2: <span style="color:#703daa">U</span>) -> (<span style="color:#703daa">U</span>, <span style="color:#703daa">T</span>) {</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> (arg2, arg1)</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> }</div></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><br></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><br></div><div style="margin:0px;line-height:normal">The keyword return would still be there for breaking out of a function.</div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=XvhdqKbdF5CD2eicBgtDxwV9X23JIVEhXYPY5ptMu9FgeSoyFuuP9gpedRnul-2Ba9Ywwc1zcMb-2Fltv1g1Gjr-2BHYLyP1tpZkO7Ch2HnUHH9hlv8NWhCfQDwAdrNogKbkhRmKJx1Xi9ZoaSkcrrES6TSFFozpsUDzZSzJiniyKwMl-2BwSoVN9Zklvo4Pn9-2FVGspEs6LVZaEgNPENgbQNG1j1W7c6s8vSFx6-2FtUUhV3iuDho-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important">
</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><br clear="all"><div><br></div>-- <br><div class="gmail_signature">bitCycle AB | Smedjegatan 12 | 742 32 Östhammar | Sweden<br><a href="http://www.bitcycle.com/" target="_blank">http://www.bitcycle.com/</a><br>Phone: +46-73-753 24 62<br>E-mail: <a href="mailto:jens@bitcycle.com" target="_blank">jens@bitcycle.com</a><br><br></div>
</div>