> Am 31.05.2016 um 10:14 schrieb Chris Williams via swift-evolution 
> <swift-evolution@swift.org>:
> 
> Honestly what I’ve wanted for quite some time is just reasonable default 
> parameter names. $0/$1… or any variation on index-based arguments is terrible 
> for comprehension, and I feel like I’m being lazy and hurting whoever has to 
> look at the code next every time I type out something like say <A [String: 
> String]?.map { $0 } instead of .map{ key, value in key }.

So, just write the latter.

> If the Dictionary type’s map function could define “key” and “value” as 
> parameter types it would go a long way in terms or readability, in my opinion.

The map function does not impose names on the arguments of the literal closure. 
You can choose them freely.

-Thorsten 
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to