> On 2 May 2017, at 04:44, Xiaodi Wu <[email protected]> wrote:
> 
> Does this gain something by being part of the standard library as opposed to 
> being built on top of it?

Well, somebody thought repeatElement<T> was general enough to make part of the 
standard library. If we’re going to allow repeating a single item as a 
Collection, we might as well allow generalise it to repeating any Collection in 
a loop (including a CollectionOfOne, which is the existing use-case).

Personally, I usually want to repeat a collection of things far more often than 
I want to repeat an individual thing. It annoys me that the standard library 
only provides the one I almost never need.

Additionally, it could help remove the top-level “repeatElement” function, 
which I know irritates some people who would rather us not have any top-level 
functions in the standard library.

- Karl
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to