[swift-evolution] ed/ing, InPlace, Set/SetAlgebra naming resolution
Charles Kissinger
crk at akkyra.com
Thu Feb 11 13:32:45 CST 2016
I like Thorsten’s suggestion. I’m not an authority, but as far as I can tell, ‘add’ and ’subtract' are still mathematical correct and precise when used this way.
—CK
> On Feb 11, 2016, at 10:49 AM, Thorsten Seitz via swift-evolution <swift-evolution at swift.org> wrote:
>
> "intersection should form a pair with „union“, both being a noun.
>
> "unioning“ is a bad choice. AFAIK „union“ is only rarely used as verb, so its present participle just sounds … strange.
>
>
> I’d like to repeat my suggestion:
>
> mutating (verbs):
> x.intersect(x)
> x.add(x)
> x.subtract(x)
>
> nonmutating (nouns):
> x.intersection(x)
> x.union(x)
> x.difference(x)
>
>
> -Thorsten
>
>
>> Am 11.02.2016 um 19:06 schrieb Joe Groff via swift-evolution <swift-evolution at swift.org>:
>>
>>
>>> On Feb 11, 2016, at 8:52 AM, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
>>>
>>>
>>> Hi All,
>>>
>>> The API guidelines working group took up the issue of the InPlace suffix
>>> yesterday, and decided that it was not to be used anywhere in the
>>> standard library. We are planning to apply the changes shown here
>>> <https://gist.github.com/dabrahams/d872556291a3cb797bd5> to the API of
>>> SetAlgebra (and consequently Set) to make it conform to the guidelines
>>> under development.
>>>
>>> Comments welcome as usual,
>>
>> -/// - `x.intersect(x) == x`
>> -/// - `x.intersect([]) == []`
>> -/// - `x.union(x) == x`
>> -/// - `x.union([]) == x`
>> +/// - `x.intersection(with: x) == x`
>> +/// - `x.intersection(with: []) == []`
>> +/// - `x.unioning(with: x) == x`
>> +/// - `x.unioning(with: []) == x`
>>
>> What's with the (with:)? That seems like a pretty needless word. Same with 'of:' and friends.
>>
>> -Joe
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-evolution
>
> _______________________________________________
> 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