Re: [swift-users] Generators vs. errors

2016-04-12 Thread Brent Royal-Gordon via swift-users
> On Apr 12, 2016, at 11:53 AM, Jens Alfke via swift-users > wrote: > > What should one do, when implementing a Generator, if the underlying data > source can experience errors? Generator.next isn’t allowed to throw, only to > return nil at the end of the sequence. > > The only idea I can th

Re: [swift-users] Trouble constraining a generic type in an extension

2016-04-12 Thread Brent Royal-Gordon via swift-users
> I *think* the feature you’re trying to use is on the todo list for Swift 3, > but the last time I said that, I was completely wrong. The swift-evolution > mailing list probably has more information. I think it's on the list of things they'd like to do to generics in the future, but it's a ver

[swift-users] New Swift snapshots available!

2016-04-12 Thread Mishal Shah via swift-users
New Swift snapshots available! Download new packages from https://swift.org/download/ Swift 2.2.x: (swift-2.2-branch) Following repository are tagged with swift-2.2.1-SNAPSHOT-2016-04-12-a https://github.com/apple/swift

Re: [swift-users] Trouble constraining a generic type in an extension

2016-04-12 Thread David Sweeris via swift-users
Bool isn’t a class (or protocol), so nothing can inherit from it. Until Swift gains the ability to extend generic types where their parameters are *equal* to concrete types, as opposed to where they *inherit from or conform to* something, I think the best you can do is this: public extension che

Re: [swift-users] Generators vs. errors

2016-04-12 Thread David Sweeris via swift-users
I think I’d either just end the sequence on an error, or do like you were thinking and have a function/computed property that gives an array containing all the rows which had an error or something. I’m not a DB guy, though. - Dave Sweeris > On Apr 12, 2016, at 1:53 PM, Jens Alfke via swift-use

[swift-users] Generators vs. errors

2016-04-12 Thread Jens Alfke via swift-users
What should one do, when implementing a Generator, if the underlying data source can experience errors? Generator.next isn’t allowed to throw, only to return nil at the end of the sequence. The only idea I can think of is to add an `error` property to my Generator implementation, and request th

[swift-users] How to set swift-DEVELOPMENT-SNAPSHOT-2016-03-24-a as default version in the commandline on OSX 10.11.4?

2016-04-12 Thread Norbert Fuhs via swift-users
Hi I'm new to coding in Swift and I use an Mac with also ubuntu on it and have a strange problem: On ubuntu 15.10 I could install the latest Swift Version without any problems and If i do swift --version it shows its the latest trunk release with Swift Package Manager 0.1 On OS X i installed all

Re: [swift-users] [swift-evolution] Requesting default values for Cocoa/Cocoa Touch APIs

2016-04-12 Thread Erica Sadun via swift-users
> On Apr 11, 2016, at 4:32 PM, Dave Abrahams via swift-evolution > wrote: > > > on Mon Apr 11 2016, Russ Bishop wrote: > >> Wouldn’t this be the responsibility of UIKit/AppKit teams to provide >> extensions >> that pass the default values? > > Yup. Please file radars against those compone

[swift-users] Trouble constraining a generic type in an extension

2016-04-12 Thread Jens Alfke via swift-users
I’ve got a simple generic struct that wraps an instance of its parameter type. public struct check { let actual: T public init(_ a: T) {actual = a} ... Now I want to add a method that only works with a specific type, Bool: public func isTrue(){XCTAssertTrue(actual)} As I’d ex