<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="">Well, it’s debatable if this would be simpler considering you’d introduce a new syntax. However I agree that inferred return type would be great.</div><div class=""><br class=""></div><div class="">If we can do:</div><div class=""><br class=""></div><div class="">var aProperty = 10</div><div class=""><br class=""></div><div class="">It would be nice to be able to do</div><div class=""><br class=""></div><div class="">var anotherProperty { foo * 2 }</div><br class=""><div class="">
<div class="">— Radek</div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 21 Dec 2015, at 08:52, ilya &lt;<a href="mailto:ilya.nikokoshev@gmail.com" class="">ilya.nikokoshev@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="white-space:pre-wrap" class="">For those simple computed var cases I wonder if we could use a simpler definition, inferring the type:<br class=""><br class="">var twiceSomething =&gt; something * 2 <br class=""><br class="">On the other hand,  it'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 class=""><div class="gmail_quote"><div dir="ltr" class="">On Sun, Dec 20, 2015 at 23:29 Radosław Pietruszewski &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""></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" 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><div style="word-wrap:break-word" class=""><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>&nbsp;twiceSomething:&nbsp;<span style="color:rgb(112,61,170)" class="">Int</span>&nbsp;{&nbsp;<span style="color:rgb(187,44,162)" class="">self</span>.something *&nbsp;<span style="color:rgb(39,42,216)" class="">2</span>&nbsp;}</blockquote></div></div><br class=""></div><div style="word-wrap:break-word" class=""><div class="">
<div class="">— Radek</div>
</div></div><div style="word-wrap:break-word" class="">
<br class=""><div class=""><blockquote type="cite" class=""><div class="">On 19 Dec 2015, at 14:30, Craig Cruden via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class=""><div class=""><div style="word-wrap:break-word" 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.&nbsp;</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="">&nbsp; &nbsp;&nbsp;<span style="color:#bb2ca2" class="">func</span> flipFunc&lt;T, U&gt;(arg1: <span style="color:#703daa" class="">T</span>, arg2: <span style="color:#703daa" class="">U</span>) -&gt; (<span style="color:#703daa" class="">U</span>, <span style="color:#703daa" class="">T</span>) {</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="">&nbsp; &nbsp; &nbsp; &nbsp; (arg2, arg1)</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="">&nbsp; &nbsp; }</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="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" class="">
</div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class="">
<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" class="">
</div>
_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
</blockquote></div>
</div></blockquote></div><br class=""></body></html>