on Fri Jun 17 2016, Brent Royal-Gordon <[email protected]> wrote:
>> – What sin(x) should do is unambiguous, unlike array.filter { ... }.
>
> A decent argument label, like `including` or even `to`, would fix the
> name `filter`.
x.filter(to: isPrime)
? I don't think that reads nearly as well as
x.where(isPrime)
even when considering the term-of-art recognizability.
> And as I said, if we feel `filter` is unsalvageable, the alternate
> Smalltalk-lineage `select` is clearer.
Than “where?”
>> – There's very significant brevity issues here, e.g. hyperbolicArcTangent()
>> vs atanh().
>
> Sure, but `mappingAndFlattening(to:)` would have brevity issues as
> well. (You didn't think the API Guidelines merely meant "add -ed or
> -ing to everything", did you?)
That would, IMO, be:
x.flatMapping(fourCopies)
--
Dave
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution