[swift-evolution] [Re-Review] SE-0104: Protocol-oriented integers
moiseev at apple.com
Tue Feb 21 14:39:52 CST 2017
> On Feb 18, 2017, at 12:02 PM, Karl Wagner via swift-evolution <swift-evolution at swift.org> wrote:
> I assume the “SignedNumber” protocol is the same as the existing one in the standard library. That is to say, Strideable.Stride will now conform to Number and have operators.
SignedNumber will *not* be the same. It is just the same name.
Stride will have operators, yes. Strideable in general will not, unless it’s a _Pointer. (you can find the current implementation prototype here <https://github.com/apple/swift/blob/new-integer-protocols/stdlib/public/core/Stride.swift.gyb>).
> Also minor nitpick, would it be too onerous to require Number.Magnitude to be Comparable? Currently it’s only Equatable and ExpressibleByIntegerLiteral.
Magnitude is supposed to conform to Arithmetic (or Number, or whatever it ends up being called), but the recursive constraints feature is missing, therefore we constrained it with the protocols that Arithmetic itself refines.
Why would you want Comparable?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution