News for hackers. Stuff that matters.
Re:Swift 2.2 Released by apetrovic on Tuesday March 22, 2016 @05:13AM (#11335248)
I love Swift dearly - I spent two years in Objective C land, after 8 years of C# and 10-ish years of C++ pain, and started using Swift day to day from Swift 1.2. But the current version have one big gaping hole: generic protocols are utter shit. For the uninitiated: Swift generic protocols don't have generic parameters, they have type constraints. Which means that a function can't return generic protocol. Which is the stupidest thing ever.

There's a way to dance around that restriction, by making an intermediate class to do type erasure by hand (why I should do that? That's compiler's job), but still - Swift crew are obviously very talented bunch with a good taste, how they allowed such nonsense from the start?

PS I don't want to sound too negative, Swift replaced C# as my favorite language, 95% of the time it's joy to use (especially after Objective C, I never agreed with that language), it's just - the generic protocol thing drives me mad.

Re:Swift 2.2 Released by AsyncAwait on Tuesday March 22, 2016 @05:52AM (#11335397)
Yeah, somewhat related to that; it's not currently possible to have typealias for a type with generic parameters, one has to wrap it in a struct or an enum, however Swift is very much not done and they're catching up quickly, so I'm optimistic, especially now that we can see and affect what's coming next.
Re:Swift 2.2 Released by melloclello on Tuesday March 22, 2016 @06:48AM (#11335569)
Generic typealiases are coming, thank goodness: http://ericasadun.com/2016/03/08/generic-typealiases-are-a-t...
Re:Swift 2.2 Released by AsyncAwait on Tuesday March 22, 2016 @08:08AM (#11335849)
Awesome! This is what I'm talking about; now that Swift is open-source we can see which improvements have landed and what is coming next. Thanks for the link.