[swift-evolution] [Proposal] function "return" optional keyword.

Craig Cruden ccruden at novafore.com
Sat Dec 19 20:29:21 CST 2015


I looked at the discussion and it looked like they were discussion two things combined.
   - inferred return type (on function signature) 
   - and omitting return on the return.

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.

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.


> On 2015-12-20, at 4:15:15, Stephen Christopher via swift-evolution <swift-evolution at swift.org> wrote:
> 
> The discussion I was remembering, comment courtesy of Chris: 
> https://devforums.apple.com/message/1014317#1014317 <https://devforums.apple.com/message/1014317#1014317>
> 
> (linked from https://devforums.apple.com/thread/255242 <https://devforums.apple.com/thread/255242>)
> 
>  _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151220/6f99c73e/attachment.html>


More information about the swift-evolution mailing list