Re: [swift-corelibs-dev] NSURL getResourceValue

2016-04-01 Thread Daniel Eggert via swift-corelibs-dev
> On 31 Mar 2016, at 21:44, Tony Parker wrote: > > Hi Zach, Daniel, > >> On Mar 31, 2016, at 11:03 AM, Zach Waldowski via swift-corelibs-dev >> wrote: >> >> The semantics of the methods are fairly nuanced in ObjC. >> >> You can have a resource value that fails to be fetched, or one that >>

Re: [swift-corelibs-dev] NSURL getResourceValue

2016-03-31 Thread Tony Parker via swift-corelibs-dev
Hi Zach, Daniel, > On Mar 31, 2016, at 11:03 AM, Zach Waldowski via swift-corelibs-dev > wrote: > > The semantics of the methods are fairly nuanced in ObjC. > > You can have a resource value that fails to be fetched, or one that > succeeded to fetch but had no value. A Swift version would mode

Re: [swift-corelibs-dev] NSURL getResourceValue

2016-03-31 Thread Zach Waldowski via swift-corelibs-dev
The semantics of the methods are fairly nuanced in ObjC. You can have a resource value that fails to be fetched, or one that succeeded to fetch but had no value. A Swift version would model this as `throws -> AnyObject?`. For the dictionary version, you may ask for a resource value, it succeeds,

Re: [swift-corelibs-dev] NSURL getResourceValue

2016-03-31 Thread Daniel Eggert via swift-corelibs-dev
Well, there's func resourceValuesForKeys(_ keys: [String]) throws -> [String : AnyObject] which doesn't use AutoreleasingUnsafeMutablePointer, but that doesn't exist in Swift, either. And the other one could have a replacement like so: func resourceValue(forKey key: String) -> AnyObject throws

Re: [swift-corelibs-dev] NSURL getResourceValue

2016-03-31 Thread Zach Waldowski via swift-corelibs-dev
You can't have AutoreleasingUnsafeMutablePointer without Objective-C interop. Zach On Thu, Mar 31, 2016, at 07:17 AM, Daniel Eggert via swift-corelibs-dev wrote: > What's the reason for the "resource value" API on NSURL not being present > in SwiftFoundation? > > /Daniel > > > func getResource

[swift-corelibs-dev] NSURL getResourceValue

2016-03-31 Thread Daniel Eggert via swift-corelibs-dev
What's the reason for the "resource value" API on NSURL not being present in SwiftFoundation? /Daniel func getResourceValue(_ value: AutoreleasingUnsafeMutablePointer, forKey key: String) throws ___ swift-corelibs-dev mailing list swift-corelibs-dev