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

Tino Heth 2th at gmx.de
Sat Dec 19 11:45:37 CST 2015


Afaik the concept is quite common when "everything is an expression", which can be a nice feature of a language:
It saves keystrokes, and allows constructs like
let value = switch key {…}
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.  
Imho clarity is reduced, and it can look a little bit odd to end a function with a line like
value

On the other hand, nobody would be forced to skip the "return", and I guess it wouldn'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.

Tino


More information about the swift-evolution mailing list