[swift-evolution] [Accepted] SE-0133: Rename flatten() to joined()

Chris Lattner clattner at apple.com
Wed Jul 27 22:51:52 CDT 2016


> On Jul 27, 2016, at 4:00 PM, Jacob Bandes-Storch <jtbandes at gmail.com> wrote:
> 
> I figured that sentence was in reference to the methods currently named flatten().
> 
> The proposal also said that the String-based version of joined(separator:) (which are implemented separately) should have a default separator of "". There is currently no flatten() for collections of Strings.
> 
> https://github.com/apple/swift/blob/c6e828f761fc30f7ce444431de7da52814f96595/stdlib/public/core/String.swift#L769 <https://github.com/apple/swift/blob/c6e828f761fc30f7ce444431de7da52814f96595/stdlib/public/core/String.swift#L769>
> 
> I doubt there would be a performance difference between adding `func joined() { return joined(separator: "") }` and changing the parameter to `separator: String = "”`.

I’ll let a stdlib guru comment on this :-)

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160727/95c6c0d1/attachment.html>


More information about the swift-evolution mailing list