[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

[swift-corelibs-dev] dispatch_data_t and NSData

2016-03-31 Thread Daniel Eggert via swift-corelibs-dev
Is there interest in bridging between dispatch_data_t and NSData similar to what's available with Darwin Foundation. Being able to avoid buffer copies seems like a big win. And with libdispatch (almost) being available on Linux, would it make sense to back (immutable) NSData with libdispatch in

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

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
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 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