[swift-evolution] [Draft][Proposal] Formalized Ordering

Karl razielim at gmail.com
Fri Jul 22 09:45:36 CDT 2016


> On 22 Jul 2016, at 03:11, Robert Widmann via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Hello Swift Community,
> 
> Harlan Haskins, Jaden Geller, and I have been working on a proposal to clean up the semantics of ordering relations in the standard library.  We have a draft that you can get as a gist. <https://gist.github.com/CodaFi/f0347bd37f1c407bf7ea0c429ead380e>  Any feedback you might have about this proposal helps - though please keeps your comments on Swift-Evolution and not on the gist.
> 
> Cheers,
> 
> ~Robert Widmann
> 
> 
> 
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

I fear that this will become confusing (especially since Equatable may now be implemented as a static function, too). We will have 3 different “equality” comparisons in Swift:

=== for reference-types
== for all types
areSame() which may be subtly different to ==

In order to have an opinion on whether or not this is justified, I need to know more about how areSame() may differ from == and how this will affect generic code. What is required that could not fit inside an override of Equatable? If this only applies to a few types, will it be its own protocol (e.g. EquivalenceCheckable)?

Karl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160722/a0d1034d/attachment.html>


More information about the swift-evolution mailing list