[swift-evolution] Better Swift interface for NSDecimal
anthony.parker at apple.com
Mon Feb 29 17:16:33 CST 2016
> On Feb 26, 2016, at 7:41 AM, Florian Reinhart via swift-evolution <swift-evolution at swift.org> wrote:
> Using NSDecimal from Swift isn’t fun. There are UnsafePointer<NSDecimal> all over the place.
> It would be nice to have a Swift-like interface to work with NSDecimal. This can easily be achieved using an extension on NSDecimal. Here is something I quickly hacked together in a playground: https://gist.github.com/florianreinhart/99bb3a079075eaf640f1
> The extension exposes all NSDecimal functions as mutating instance methods on NSDecimal. The instance methods throw if there is any error provided from the underlying NSDecimal function. I have also added operators, but I am not sure if this is a good idea.
> What do you think about this?
> How is the process of integrating something like this into Swift (since this is an API addition to Foundation)?
Right now we’re pretty wrapped up in the naming changes and other work, but it’s clear NSDecimal can use some attention in Swift. I’m hoping it is something we can spend some time on soon, but I don’t have any concrete plans for Swift 3.
> swift-evolution mailing list
> swift-evolution at swift.org
More information about the swift-evolution