[swift-evolution] [Review] SE-0056: Allow trailing closures in `guard` conditions

Patrick Gili gili.patrick.r at gili-labs.com
Sat Apr 2 14:39:40 CDT 2016

> What is your evaluation of the proposal?
I think there is a lot of value to allowing trailing closures in the guard condition clause. However, not at the cost of inconsistency. We have reviewed many proposals over the last month that addressed consistency issues in the Swift language, and if I'm not mistaken, all of them have been accepted by the community, larger to eliminate the inconsistency.

Because of this, I think two of the alternatives stated by the proposal have credibility:
1) Eliminate the "else" keyword from the guard syntax.
2) Add keywords to "if", "while", "for", and "switch" to delineate the condition clause from the body of the statement.

The second alternative has more appeal, because it supports trailing closures without "heroics".

> Is the problem being addressed significant enough to warrant a change to Swift?

> Does this proposal fit well with the feel and direction of Swift?
No. Please don't add inconsistencies to the language, as we're just going to have to deal with it down the road.

> If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
Not in my experience.

> How much effort did you put into your review? A glance, a quick reading, or an in-depth study?

In-depth study.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160402/7266b302/attachment.html>

More information about the swift-evolution mailing list