<p dir="ltr">Yes, this would be strange in multiline functions with different execution paths. It works well in Ruby because function return types aren&#39;t annotated, so the final expression is always a valid return value. In swift, I think it would have too much design overhead to figure out how to reconcile it with explicit return types, to be worth it with multiline functions. However, it would be great to have implicit return in single line closures with named parameters and single line functions. </p>
<br><div class="gmail_quote"><div dir="ltr">On Sat, Dec 19, 2015, 2:28 PM Step C via swift-evolution &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">There was discussion of implicit returns on the forums a while back. Will try to find the link later. The Swift team chose explicit returns for better code clarity. I still think this was the right call, even though implicit returns are certainly attractive when writing code.<br>
<br>
<br>
&gt; On Dec 19, 2015, at 12:45 PM, Tino Heth via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br>
&gt;<br>
&gt; Afaik the concept is quite common when &quot;everything is an expression&quot;, which can be a nice feature of a language:<br>
&gt; It saves keystrokes, and allows constructs like<br>
&gt; let value = switch key {…}<br>
&gt; But as the let syntax was changed to work with delayed assignment, one major use case is solved in a different way, and I doubt that it fits into the Swift roadmap.<br>
&gt; Imho clarity is reduced, and it can look a little bit odd to end a function with a line like<br>
&gt; value<br>
&gt;<br>
&gt; On the other hand, nobody would be forced to skip the &quot;return&quot;, and I guess it wouldn&#39;t be a complicated change in the compiler… so if you want to continue working on the proposal, I would evaluate how this change could be reflected in the docs.<br>
&gt;<br>
&gt; Tino<br>
&gt; _______________________________________________<br>
&gt; swift-evolution mailing list<br>
&gt; <a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
&gt; <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>
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>