<div style="white-space:pre-wrap">For those simple computed var cases I wonder if we could use a simpler definition, inferring the type:<br><br>var twiceSomething =&gt; something * 2 <br><br>On the other hand,  it&#39;s better to specify types for names that can be visible outside of current scope explicitly. So may be the getter declared via this syntax should always be private. </div><br><div class="gmail_quote"><div dir="ltr">On Sun, Dec 20, 2015 at 23:29 Radosław Pietruszewski &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br></div><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>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><br></div><div>*However*, as others pointed out, having to type `return` is a bit tiring in the context of a computer property’s “get”:</div></div><div style="word-wrap:break-word"><div><br></div><div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><blockquote type="cite"><span style="color:rgb(187,44,162)">var</span> twiceSomething: <span style="color:rgb(112,61,170)">Int</span> { <span style="color:rgb(187,44,162)">self</span>.something * <span style="color:rgb(39,42,216)">2</span> }</blockquote></div></div><br></div><div style="word-wrap:break-word"><div>
<div>— Radek</div>
</div></div><div style="word-wrap:break-word">
<br><div><blockquote type="cite"><div>On 19 Dec 2015, at 14:30, Craig Cruden via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br><div><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&lt;T, U&gt;(arg1: <span style="color:#703daa">T</span>, arg2: <span style="color:#703daa">U</span>) -&gt; (<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=4hhvaxvZNsLrnZM9llg93kxoqfFYC8lhv8HAehOIDqIIX-2BB9R8E1jk2QPl4GDWf1csw0oIX0kbMf471D6Iu6nP8tdKIqzYwLCOE9dPklFiN-2BxwiaJD8g2RGSNaVoz1o9DQwiTZ0AjOYfq-2FkeIvejq27DyFs079lahlQmBrf4hPf129SvHS3rKeLPM1BBjAfofGsgGs-2FeqwaHHJBB-2BfAOag52KrJ1Y5wsOujheg-2Fm0vs-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>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div></blockquote></div><br>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=1p9Jer2O6jVE9KWvo-2B9iUaEyN8slp4IizyiLwsfp54MMSfM9YtP3qyJ-2BKKLH0daAWOR3qqBZN7VOMzO3yNYlHIHEs-2FCPXNlr-2Fk8Sx-2BvcU-2Bcj4Yb5oOlybh32KTiIDMTtNPXYhaxbDD2-2B0RtnY1XtUgc5UvpQflit22aYSK-2FEjKH5vh5CUoykOg2Y0PcCjQgigf-2Bvjm-2F5znyV1QVEAzpafupRddqBnMF43JNCFn0Aj70-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>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">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>
</blockquote></div>