Re: [swift-users] String initializers and developer ergonomics

2016-05-09 Thread Zach Waldowski via swift-users
On Mon, May 9, 2016, at 01:25 PM, Joe Groff via swift-users wrote: > This definitely strikes me as a problem. The String(_:) constructor is > very easy to call by accident if you're trying to hit another unlabeled > initializer. It also strikes me as not particularly "value-preserving", > since str

Re: [swift-users] CGPathApply

2016-05-12 Thread Zach Waldowski via swift-users
This seems to do it: https://gist.github.com/zwaldowski/7e6eacc9dea0682690a820afa62e54ff Problems are just like any context-based C API, you need to squeeze all the important stuff into a word-size thing. Cheers!   Zachary Waldowski   z...@waldowski.me On Thu, May 12, 2016, at 09:04 PM, Jonathan

Re: [swift-users] CGPathApply

2016-05-13 Thread Zach Waldowski via swift-users
Quinn The Eskimo! via swift-users wrote: > > On 13 May 2016, at 06:24, Zach Waldowski via swift-users > wrote: > > > Problems are just like any context-based C API, you need to squeeze all > > … and the best way to do that is to use a closure. > > typealia

Re: [swift-users] Why does RangeReplaceableCollection require an empty initialiser?

2016-07-06 Thread Zach Waldowski via swift-users
I have the same misgivings. The other day, I was wanted to add a piece of metadata to a Slice type conforming to RangeReplaceableCollection (coming from the containing collection) but couldn't figure out a way to make it safe with the empty initializer. It's bugged me a few times similarly. Cheer

Re: [swift-users] changes to pointer data types in Xcode 8 beta 6

2016-08-15 Thread Zach Waldowski via swift-users
Nerd here! That part of the code ends up not needing to go through the UnsafeRawPointer API, as it's processing UTF-8 bytes, see also: . That being said, good resources for reading about the new pointer system are: - [SE-0107]:

Re: [swift-users] Proper Way to make Errors in Swift 3

2016-09-29 Thread Zach Waldowski via swift-users
Error types themselves shouldn’t generally cross into Objective-C, because you don’t get interop; for that, we have Error, which crosses the bridge as NSError. If it’s instructive to think of it this way, both Objective-C and Swift should define errors in their best native way, and use NSError.

Re: [swift-users] [Swift Package Manager] Use of Info-plist; use for apps

2017-08-22 Thread Zach Waldowski via swift-users
I haven’t yet had the pleasure of investigating what’s available in 3.2/4.0’s swiftpm, but I did once hack this together in the 3.x toolchain using a dummy module: Hierarchy: Sources/ -- InfoPlist Dummy.c include/ -- InfoPlist.h InfoPlist.h: ``` __attribute__((used, section("__TEXT