[swift-evolution] ed/ing, InPlace, Set/SetAlgebra naming resolution

Dave Abrahams dabrahams at apple.com
Fri Feb 12 16:16:48 CST 2016


on Fri Feb 12 2016, Thorsten Seitz <swift-evolution at swift.org> wrote:

> intersect is a verb so it is fine for mutating.

Actually, it is a verb, but has the wrong sense.  If I have two disjoint
sets and I tell one to intersect the other, maybe I mean for it to add
an element from the other set so that they intersect.  The union
operation would actually satisfy that request.

> 
> The noun intersection can then be used for the nonmutating variant.
>
> remove/merge/add/unite sound all good to me for for the mutating variant of union.
>
> -Thorsten 
>
>> Am 11.02.2016 um 20:19 schrieb Craig Cruden
>> <ccruden at novafore.com>:
>> 
>> I was trying to think of a non mathematical term for intersect in a mutating manner….
>> 
>> but that one is hard…. the only thing that came to mind was
>> “overlap” but I don’t think anyone would find it (maybe not a bad
>> thing :p )
>> 
>> 
>>> On 2016-02-12, at 2:05:59, Craig Cruden
>>> <ccruden at novafore.com> wrote:
>>> 
>>> I was thinking of maybe:
>>> 
>>> x.remove(x) for subtract (java mutable remove).  
>>> 
>>>> On 2016-02-12, at 2:00:41, Thorsten Seitz
>>>> <tseitz42 at icloud.com> wrote:
>>>> 
>>>> Good idea!
>>>> 
>>>> -Thorsten
>>>> 
>>>> 
>>>>> Am 11.02.2016 um 19:52 schrieb Craig Cruden
>>>>> <ccruden at novafore.com>:
>>>>> 
>>>>> or x.merge(x) for mutating union.
>>>>> 
>>>>>> On 2016-02-12, at 1:49:23, Thorsten Seitz via swift-evolution
>>>>>> <swift-evolution at swift.org> wrote:
>>>>>> 
>>>>>> I’d like to repeat my suggestion:
>>>>>> 
>>>>>> mutating (verbs):
>>>>>> x.intersect(x)
>>>>>> x.add(x)
>>>>>> x.subtract(x)
>> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

-- 
-Dave



More information about the swift-evolution mailing list