[swift-evolution] Allow use of ; in anonymous closures

Robert Widmann devteam.codafi at gmail.com
Wed Aug 17 11:12:32 CDT 2016


`in` is syntactic fluff to disambiguate the end of a parameter list and the start of the closure's body, not a statement.  In that regard it needs no additional delimiters like semicolons.

~Robert Widmann

2016/08/17 8:38、Braeden Profile via swift-evolution <swift-evolution at swift.org> のメッセージ:

> Okay, I currently love closure syntax, but something doesn’t sit right with me.  Why can’t I write…
> 
> [6,5].map { n in; n+1 }
> 
> …where there’s a semicolon after the parameter list?  I think it looks better, and should at least be allowed (not required).
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution


More information about the swift-evolution mailing list