[swift-evolution] [Review] SE-0104: Protocol-oriented integers
dabrahams at apple.com
Mon Jun 27 18:09:39 CDT 2016
on Fri Jun 24 2016, Brent Royal-Gordon <swift-evolution at swift.org> wrote:
>> I don't have anything else to add to the concerns that have already
> been discussed, but I would like to reiterate on the fact that having
> the ,absoluteValue, property but without substituting 'abs' will
> induce a lot of programers to use it anyway and make mistakes.
> `FloatingPoint` seems to have a similar concept to `absoluteValue`
> that's called "magnitude", although there's no actual `magnitude`
> property. Would that be a better name for this concept?
That's not a terrible idea. :-)
> And if so, should it be on `Arithmetic`? I don't think the
> `FloatingPoint` spec actually specifies how absolute values should be
> handled (for that matter, I don't think this one does either), and
> currently it seems to come out of an `AbsoluteValuable` protocol that
> I haven't seen mentioned in either the Integer or FloatingPoint
Yes, that protocol should die as part of this.
More information about the swift-evolution