<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="">I have to agree with everything Ilya has mentioned in her response.<div class=""><br class=""></div><div class="">It comes down to readability. Omit the "return" keyword from a function and points that the function returns become hard to see. The optional "return" keyboard in Ruby is one of the few features of Ruby that I genuinely dislike for this reason. Of course, Ruby makes it more difficult because it doesn't type methods.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">-Patrick</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 20, 2015, at 7:11 AM, ilya via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">-1 on inferred return type and omitting return with func<div class=""><br class=""></div><div class=""><div class=""><div class="">Both features are actually available in the language as-is, just not with the func keyword:</div><div class=""><br class=""></div><div class="">let someInferredFunction = { _ in 5} &nbsp;// () -&gt; Int</div></div><div class=""><br class=""></div><div class="">When teaching Swift we actually teach func + return keywords together, they make it easy to see all possible return paths from a function.</div><div class=""><br class=""></div><div class="">And we recommend using func instead of a closure when there is a multiline body with control statements. Having implicit return in that case hurts readability.&nbsp; For example, out of three possible return points within this function only one is not marked with return:</div><div class=""><br class=""></div><div class="">func f(input: Int) -&gt; Int {</div><div class="">&nbsp; &nbsp; if input &gt; 10 {&nbsp;</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; return 10&nbsp;</div><div class="">&nbsp; &nbsp; }</div><div class="">&nbsp; &nbsp; if input &lt; 0 {&nbsp;</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; return 0&nbsp;</div><div class="">&nbsp; &nbsp; }</div><div class="">&nbsp; &nbsp; input</div><div class="">}</div><div class=""><br class=""></div><div class=""><div class=""><div class="gmail_extra"><br class=""></div><div class="gmail_extra">+1 on omitting return from var {} declaration, those methods look like closures and will often be one-liners.</div><div class="gmail_extra"><br class=""></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Sun, Dec 20, 2015 at 5:29 AM, Craig Cruden via swift-evolution<span class="Apple-converted-space">&nbsp;</span><span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span><span class="Apple-converted-space">&nbsp;</span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class="">I looked at the discussion and it looked like they were discussion two things combined.<div class="">&nbsp; &nbsp;- inferred return type (on function signature)&nbsp;</div><div class="">&nbsp; &nbsp;- and omitting return on the return.</div><div class=""><br class=""></div><div class="">I agree with Chris on the fact that the function should have the type of return specified on the signature and not inferred since it is useful for API documentation to know that ahead of time on a strongly typed language.</div><div class=""><br class=""></div><div class="">What is not necessary is actually forcing people to type return “x” on the last line - since “return” is rather redundant and clutter for those people of a functional programming paradigm point of view.</div><div class=""><br class=""></div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class=""><div class="h5"><div class="">On 2015-12-20, at 4:15:15, Stephen Christopher 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></div><div class=""><div class=""><div class="h5"><div dir="ltr" class="">The discussion I was remembering, comment courtesy of Chris:&nbsp;<div class=""><a href="https://devforums.apple.com/message/1014317#1014317" target="_blank" class="">https://devforums.apple.com/message/1014317#1014317</a><br class=""></div><div class=""><br class=""></div><div class="">(linked from&nbsp;<a href="https://devforums.apple.com/thread/255242" target="_blank" class="">https://devforums.apple.com/thread/255242</a>)</div><div class="gmail_extra"><br class=""></div></div></div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=CGU22LnxbYa2EM3wKvzuC6syQDwKa0tMs5IyT5gL1wJT-2BYD4vVxTNkjz3P-2BxMaTzGkQNfsZYcem-2FDROzdNqEF1b0fZQ3FxI-2FHZ812FCYxRRKvQTmUkEwUfHNDRSEVD6ddMzVM0rm-2B6SuukGhojDCOGi1k6IUbA1sCKZQc1oW1cGHIbzYuZAFeEAMdH2cdqfRhh0vJezQwp83W-2BXaRJf-2FUvAxjmQKHnwfX-2F49MLOng4U-3D" alt="" width="1" height="1" border="0" style="min-height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""><span class="Apple-converted-space">&nbsp;</span>_______________________________________________<span class=""><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=""></span></div></blockquote></div><br class=""></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=1p9Jer2O6jVE9KWvo-2B9iUaEyN8slp4IizyiLwsfp54MbWFefszu7Zz2orCFlOCV6tzT4x0VJt9uf5PHHlBokoQjJ5eXtzqVR5X0UoDf2tpT5NdTK1JiAI5QV1fY9X8Stq3RCFNNkPzBvubogqTfa-2BFy9wJB-2FyWTjgfH-2BAh3fAV9x54I7tjXBLQ6-2FWbF2vsTFznmPandfkPW0J3NiBz4Vy3D4ZNDXX8-2BycWbFJK6cokU-3D" alt="" width="1" height="1" border="0" style="min-height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""></div><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" 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=""><br class=""></blockquote></div><br class=""></div></div></div></div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=148AJ5MzQn5baqzoQt2hMqn4nNwgAXNFoK9IxIeunJUZLvUn6kTI-2F1SvAhRjJWtg21xgRSrY5omS4SuNP2Nsb0bXlYtp8MQ6b6X4Whr0YLPAVXSE8gaot-2B9GaGTHCwi8stsgWXK4LnUQVduH6hEYtK73-2FROQK9vFnGgj6znBhx2H4Fzappweo-2F-2Bq9-2FVZ4gZrRUQfUrj7bb1pEnsTTBFQI0ReyUQSeUqEtJF7mk6qgX4-3D" alt="" width="1" height="1" border="0" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><span class="Apple-converted-space">&nbsp;</span>_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">swift-evolution mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:swift-evolution@swift.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">swift-evolution@swift.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div><br class=""></div></body></html>