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

Jens Persson jens at bitcycle.com
Sat Dec 19 09:50:28 CST 2015


+1

On Sat, Dec 19, 2015 at 2:30 PM, Craig Cruden via swift-evolution <
swift-evolution at swift.org> wrote:

>
> When writing short functional code in a function it would be nice if the
> return keyword were an optional keyword.
>
> Just return the last evaluated expression.
>
>
> i.e.
>
>     func flipFunc<T, U>(arg1: T, arg2: U) -> (U, T) {
>         (arg2, arg1)
>     }
>
>
> The keyword return would still be there for breaking out of a function.
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
>


-- 
bitCycle AB | Smedjegatan 12 | 742 32 Östhammar | Sweden
http://www.bitcycle.com/
Phone: +46-73-753 24 62
E-mail: jens at bitcycle.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151219/3d70e0b8/attachment.html>


More information about the swift-evolution mailing list