It was settled for IEEE yes, but we have some options in Swift. See Comparable and FloatingPoint types. Whether we will revisit this is yet to be seen, but the door is not completely closed.
This thread is the first time I’ve encountered this notion of needing to consider multiple models. I don’t fully grasp the implications, but it seems like the desire to consider floating point numbers a model of real numbers is the only problematic example thus far. It isn’t clear to me that this is even possible in a reasonable way as floating point numbers are able to represent values that are not reals.
I would find it very surprising if this definition was ever inconsistent with Equatable
. Is it fair to say that they will always be consistent when an Equatable
conformance is provided?
Do you have any thoughts on how this would be defined for floating point types and operations? Would floating point ==
and <
be considered pure?
It doesn’t seem like this approach is sufficient in order to suppor a third party data structure implemented from scratch using unsafe concepts. Wouldn’t the library author need to define ‘identical’ for this type? Wouldn’t we want this definition to be consistent with the definition applied by the language to fundamental types? Or did you mean that the language would also provide a clear definition of the semantics that third party libraries could also adhere to?
This makes sense as a starting point, but it obviously doesn’t address types which may use different internal representations to model the same value.