I’m having the worst time trying to get newer Swift snapshots to compile and link code — let alone getting Swift built by hand:
Unfortunately, the Swift change log, which goes in reverse chronological order is slightly messed up. I can’t find a single canonical Beta 3 cutoff where everything before that point is implemented, and after is pending.
SE-0099, which separates conditional clauses with commas while eliminating where
from associated boolean conditions is implemented.
if let x = x where x % 2 == 1 { ... } // does not compile if let x = x, x % 2 == 1 { ... } // compiles
SE-0060 is up and running too, ensuring that default arguments are specified in declaration order.
func foo(a: Int = 2, b: Int = 2, c: Int = 2) {} foo(a: 1, c: 2) // compiles foo(c: 1, a: 2) // error: argument 'a' must precede argument 'c'
However, SE-0112, which appears after (“earlier”) than SE-0099 is not.
// SE-0112 let cocoaError = NSError(domain: "org.sadun", code: 42, userInfo: [:]) do { throw cocoaError } catch { print(error.code) // bzzt, won't compile }
Yet SE-0081 (move where
clauses to the end of declarations) is working fine.
public func ==== <S1: Sequence, S2: Sequence>(seq1: S1, seq2: S2) -> Bool where S1.Iterator.Element == S2.Iterator.Element, S1.Iterator.Element: Equatable { return !longZip(seq1, seq2).contains(!=) }
Right now, I’m hoping hard that Beta 4 will get us super-close to a full “Swift 3”
Comments are closed.