<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=""><div class="">I honestly don’t have a problem with having to say `return` inside functions. That’s not necessarily a -1, but I’m reluctant to say +1 when _even I_ don’t really have the problem with extra verbosity.</div><div class=""><br class=""></div><div class="">*However*, as others pointed out, having to type `return` is a bit tiring in the context of a computer property’s “get”:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><blockquote type="cite" class=""><span style="color: rgb(187, 44, 162);" class="">var</span> twiceSomething: <span style="color: rgb(112, 61, 170);" class="">Int</span> { <span style="color: rgb(187, 44, 162);" class="">self</span>.something * <span style="color: rgb(39, 42, 216);" class="">2</span> }</blockquote></div></div><br class=""><div class="">
<div class="">— Radek</div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 19 Dec 2015, at 14:30, Craig Cruden via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">When writing short functional code in a function it would be nice if the return keyword were an optional keyword. </div><div class=""><br class=""></div><div class="">Just return the last evaluated expression.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">i.e.</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span> flipFunc<T, U>(arg1: <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">T</span>, arg2: <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">U</span>) -> (<span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">U</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">T</span>) {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> (arg2, arg1)</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> }</div></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class="">The keyword return would still be there for breaking out of a function.</div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=4hhvaxvZNsLrnZM9llg93kxoqfFYC8lhv8HAehOIDqIIX-2BB9R8E1jk2QPl4GDWf1csw0oIX0kbMf471D6Iu6nP8tdKIqzYwLCOE9dPklFiN-2BxwiaJD8g2RGSNaVoz1o9DQwiTZ0AjOYfq-2FkeIvejq27DyFs079lahlQmBrf4hPf129SvHS3rKeLPM1BBjAfofGsgGs-2FeqwaHHJBB-2BfAOag52KrJ1Y5wsOujheg-2Fm0vs-3D" alt="" width="1" height="1" border="0" style="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;" class="">
</div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>