[swift-dev] Rationalizing FloatingPoint conformance to Equatable

David Zarzycki dave at znu.io
Wed Oct 25 12:06:34 CDT 2017



> On Oct 25, 2017, at 12:01, David Sweeris <davesweeris at mac.com> wrote:
> 
> 
>> On Oct 25, 2017, at 5:29 AM, David Zarzycki via swift-dev <swift-dev at swift.org <mailto:swift-dev at swift.org>> wrote:
>> 
>> 
>> 
>>> On Oct 25, 2017, at 02:34, Xiaodi Wu via swift-dev <swift-dev at swift.org <mailto:swift-dev at swift.org>> wrote:
>>> 
>>> Please see earlier replies summarizing core team members' persuasive arguments as to why not multiple protocol hierarchies like this.
>> 
>> Hi Xiaodi,
>> 
>> The above line is does it help your argument. Even if a person was motivated to search through the entire mailing list archives looking for said arguments, they won’t be able to guess which arguments you found to be persuasive (and who was sufficiently “core” at the time, no less). Can you please provide URLs into the archives? Is that a big ask?
> 
> If I'm (now) reading this correctly, he put the argument itself at the end of his earlier reply to you:

Right, to which I replied that I wasn’t proposing the Rust model or your similar “MaybeEquatable” model. I was proposing something different where Float and Int are both Equatable and Substitutable, but neither Equatable nor Substitutable inherit from the other. The former is mathematical and the latter is not (which allows it to deal with NaN payloads, ±0, etc). Generic algorithms care mostly if not completely about mathematics, while generic containers care mostly if not completely about substitutability. They can live alongside each other and get along peacefully/sanely. And if people need to care about both, then at least they have an out.

Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20171025/0b03b5bc/attachment.html>


More information about the swift-dev mailing list