[swift-evolution] [swift-evolution-announce] [Review] SE-0118: Closure Parameter Names and Labels

Kevin Ballard kevin at sb.org
Sat Jul 9 16:56:13 CDT 2016

On Tue, Jul 5, 2016, at 04:10 PM, Chris Lattner wrote:
> 	* What is your evaluation of the proposal?

Strong +1. Overall I like all of the changes listed in this proposal, with some commentary below.

> lines.split(whereSeparator: isAllWhitespace)

I think this is ok, but I'd also be fine with split(where:).

> if roots.contains(where: isPrime) {

I strongly prefer this to the alternatives suggested in this thread. Not only is Erica right about "anywhere" being visible in containsAny(where:) or contains(anyWhere:), but those names also just feel unnecessarily cumbersome. Not only that, but using contains(where:) would be more consistent with first(where:) (which is a strongly related function; contains(where:) returns true iff first(where:) returns non-nil).

> let sum = measurements.reduce(0, +)

I'm very happy to see the closure name being removed here. I never thought the name was pulling any weight, since this function is already a term of art rather than being an english sentence.

> 	* 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?


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

Other languages don't typically have external parameter names.

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

A quick reading of the proposal and of the thread to date.

-Kevin Ballard

More information about the swift-evolution mailing list