[swift-evolution] [SR-933] Rename flatten to flattened

Guillaume Lessard glessard at tffenterprises.com
Fri Apr 8 19:45:25 CDT 2016

Thanks Brent -- I completely agree with your assessment.
I was failing to come up with the proper argument for just about the same idea!

Guillaume Lessard

> On 8 avr. 2016, at 18:32, Brent Royal-Gordon via swift-evolution <swift-evolution at swift.org> wrote:
>> The 'flatten()' method didn't get the Swift 3 API renaming treatment it should have, to go along with reversed, sorted, joined, etc.
>> As I see Dmitri Gribenko already agree with it but we still have to discuss it here. So what do you think?
> I'm in favor.
> Though all of these things are terms of art, not all terms of art are created equal. For instance:
> * `map` is supported by virtually any language which have any of these higher-order functions, and to my knowledge the name `map` is universally used.
> * `reduce` is not quite as universally supported, but it's still very common, and most (but not quite all) languages with higher-order functions support it.
> * `filter` is very widely supported, but the *name* `filter` is not quite so consistent. Ruby, for instance, calls it `select`, Perl calls it `grep`, etc.
> * `takeWhile` lies on the other end of the spectrum, being very narrowly supported.
> In my opinion, it would be a really bad idea to rename `map` or `reduce`; `filter` is probably a bad idea but not terrible; but we should feel relatively free to rename `takeWhile`.
> `flatten` is nowhere near as weak a term of art as `takeWhile`, but I think it still falls towards that end of the spectrum. We shouldn't worry too much about changing it. `map`, `reduce`, and `filter` are much stronger terms, and we should be more cautious about changing them.
> -- 
> Brent Royal-Gordon
> Architechies
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

More information about the swift-evolution mailing list