Not that I like it, but insertNonIntersectingRemoveIntersectingContentsOf(_:) would be the stylistically consistent way to convey the right sense.<br><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Feb 16, 2016 at 10:22 AM Dave Abrahams via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
on Mon Feb 15 2016, Brent Royal-Gordon <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br>
<br>
> I think you've ended up with the right approach, and I understand the need to move on, but...<br>
><br>
>> /// Returns the set of elements contained in `self` or in `other`, but not in both `self` and `other`.<br>
>> /// EXISTING: exclusiveOr<br>
>> @warn_unused_result<br>
>> func invertingIntersection(other: Self) -> Self<br>
>><br>
>> /// Replaces `self` with a set containing all elements contained in either `self` or `other`, but not both.<br>
>> /// EXISTING: exclusiveOrInPlace<br>
>> mutating func invertIntersection(other: Self)<br>
><br>
> I'm not quite happy with these. I don't like that the mutating form of<br>
> `intersection` is `intersect`, but the mutating form of<br>
> `invertingIntersection` is `invertIntersection`—it seems like both<br>
> methods should change the "intersection" part.<br>
><br>
> Have you considered going the opposite direction and combining the verb "intersect" with the adjective "inverse"?<br>
><br>
> /// Returns the set of elements contained in `self` or in `other`, but not in both `self` and `other`.<br>
> /// EXISTING: exclusiveOr<br>
> @warn_unused_result<br>
> func inverseIntersection(other: Self) -> Self<br>
><br>
> /// Replaces `self` with a set containing all elements contained in either `self` or `other`, but not both.<br>
> /// EXISTING: exclusiveOrInPlace<br>
> mutating func inverseIntersect(other: Self)<br>
> // or perhaps even `inverselyIntersect` so it's an adverb<br>
><br>
> I wouldn't be surprised if you did, because I could see you trying to<br>
> dodge the adverb problem, but I thought it was worth asking.<br>
<br>
These names all have the wrong sense, including the ones that were<br>
decided upon. “Inverting the intersection” doesn't imply that elements<br>
not in the intersection will be merged, which is what happens in a<br>
symmetric difference.<br>
<br>
--<br>
-Dave<br>
<br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div>