<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jul 22, 2016 at 1:05 PM, Dave Abrahams via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
on Thu Jul 21 2016, Duan <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
<br>
> Great proposal. I want to second that areSame may mislead user to<br>
> think this is about identity.<br>
><br>
> I like areEquivalent() but there may be better names.<br>
<br>
</span>It really *is* about identity as I posted in a previous message.</blockquote><div><br></div><div>Correct me if I'm wrong:</div><div><br></div><div>Identity is an equality relation, and `==` is about just that. By contrast, `areSame()` is to define an *equivalence* relation through which, by default, `==` is to be dispatched. Since this design specifically contemplates scenarios in which certain Equatables will override `==` *not* to dispatch through `areSame()`, the latter function evaluates only *equivalence* with respect to an arbitrary equivalence relation, not identity.</div><div><br></div><div>Put another way, the future `Equatable` is a contract that conforming types will supply a definition of equality *and* an equivalence relation, where the former by default is dispatched through the latter; but it is specifically envisioned that the two may be separated in domain-specific scenarios.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">But<br>
that doesn't change the fact that areEquivalent might be a better name.<br>
It's one of the things we considered; it just seemed long for no real<br>
benefit.<br>
<div class="HOEnZb"><div class="h5"><br>
> Daniel Duan<br>
> Sent from my iPhone<br>
><br>
>> On Jul 21, 2016, at 6:32 PM, Robert Widmann via swift-evolution<br>
>> <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
>><br>
>><br>
>>> On Jul 21, 2016, at 6:19 PM, Xiaodi Wu <<a href="mailto:xiaodi.wu@gmail.com">xiaodi.wu@gmail.com</a>> wrote:<br>
>>><br>
>>> This is nice. Is `areSame()` being proposed because static `==` is<br>
>>> the status quo and you're trying to make the point that `==` in the<br>
>>> future need not guarantee the same semantics?<br>
>><br>
>> Yep! Equivalence and equality are strictly very different things.<br>
>><br>
>>><br>
>>> Nit: I think the more common term in stdlib would be<br>
>>> `areEquivalent()`. Do you think `same` in that context (independent<br>
>>> of the word "ordering") might erroneously suggest identity?<br>
>><br>
>> There is room for improvement here. Keep ‘em coming.<br>
>><br>
>>><br>
>>><br>
>>>> On Thu, Jul 21, 2016 at 8:11 PM, Robert Widmann via<br>
>>>> swift-evolution<br>
>>>> <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
>>>> Hello Swift Community,<br>
>>>><br>
>>>> Harlan Haskins, Jaden Geller, and I have been working on a<br>
>>>> proposal to clean up the semantics of ordering relations in the<br>
>>>> standard library. We have a draft that you can get as a gist.<br>
>>>> Any feedback you might have about this proposal helps - though<br>
>>>> please keeps your comments on Swift-Evolution and not on the gist.<br>
>>>><br>
>>>> Cheers,<br>
>>>><br>
>>>> ~Robert Widmann<br>
>>>><br>
>>>><br>
>>>><br>
>>>><br>
>>>><br>
>>>> _______________________________________________<br>
>>>> swift-evolution mailing list<br>
>>>> <a href="mailto:swift-evolution@swift.org">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>
>>>><br>
>>><br>
>><br>
>> _______________________________________________<br>
>> swift-evolution mailing list<br>
>> <a href="mailto:swift-evolution@swift.org">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>
> _______________________________________________<br>
> swift-evolution mailing list<br>
> <a href="mailto:swift-evolution@swift.org">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>
><br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Dave<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">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>
</div></div></blockquote></div><br></div></div>