[swift-evolution] Stdlib closure argument labels and parameter names

David Hart david at hartbit.com
Tue Jun 21 02:41:46 CDT 2016


> On 21 Jun 2016, at 01:52, Brent Royal-Gordon via swift-evolution <swift-evolution at swift.org> wrote:
> 
> * I'm very uncomfortable with the amount of weight `accumulatingResultBy` adds to `reduce`. `combinedBy` seems perfectly cromulent to me. I'm even more concerned by your suggestion in the pull request body of `accumulating(startingFrom:combiningBy:)`. `reduce` is a subtle and slightly confusing operation; adding more words to its call sites will not solve that problem. If you want to invent a new name from whole cloth, I would probably use something like `combining(with initialResult: T, by nextResult: (T, Element) -> T)`. (For that matter, while we're working in this area, `sequence(first:next:)` could use a similar coat of paint.)

Didn’t have time to give it a thorough read, but `accumulatingResultBy` did stand out negatively for me as being a bit too verbose.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160621/9449fb6c/attachment.html>


More information about the swift-evolution mailing list