Earlier quoted context omitted.
If let (and optionals in general) is my favorite Swift feature and has immediately made my code 10x more stable from the get-go. Glad to see it get expanded like this.
I'd like to see them expand it the way Rust did: Rust lifted `if let` from Swift (I believe) but made it a more general-purpose refutable pattern matcher, it's just one step below match and works with any enum type not just Option. So you can write: enum Foo { Bar, Baz(i32), Qux(f64) } if let Bar = item { // do something } else if let Baz(val) = other { // do something with val } which is oft shorter than a full-blow…
Swift 1.2 and Xcode 6.3 beta
41–50 of 94 posts
Re: Swift 1.2 and Xcode 6.3 beta
#42This might be easily overlooked: optional has been introduced (back-ported?) to Objective-C in the form of nullability annotation!
Re: Swift 1.2 and Xcode 6.3 beta
#43How about opening Swift compiler source code (and porting it to other platforms?) And, what are the OS requirements for xcode 6.3? Is it possible to install it to old macosx system (snow leopard, for example)?
Stop it with the "open and porting". They are not going to do it.
Re: Swift 1.2 and Xcode 6.3 beta
#44This might be easily overlooked: optional has been introduced (back-ported?) to Objective-C in the form of nullability annotation!
Not exactly. ObjC code cannot usefully benefit from those annotations (yet? more likely ever). At most, it's good for documenting your ObjC code for fellow readers. The actual use appears in the Swiftland where instead of implicitly unwrapped optionals you get proper explicit optionals or explicit non-optionals.
I assume that, now that this feature exists, Apple will begin annotating their Obj-C APIs.
Re: Swift 1.2 and Xcode 6.3 beta
#45Why is being logged-in required to view the Release Notes?
You only need to be at the free level though, not the $100/year, so it's not much of a barrier.
Re: Swift 1.2 and Xcode 6.3 beta
#46Earlier quoted context omitted.
I'd like to see them expand it the way Rust did: Rust lifted `if let` from Swift (I believe) but made it a more general-purpose refutable pattern matcher, it's just one step below match and works with any enum type not just Option. So you can write: enum Foo { Bar, Baz(i32), Qux(f64) } if let Bar = item { // do something } else if let Baz(val) = other { // do something with val } which is oft shorter than a full-blow…
Swift borrowed "if let" from Rust, not the other way around.
https://github.com/rust-lang/rfcs/blob/master/text/0160-if-l...
Re: Swift 1.2 and Xcode 6.3 beta
#47Earlier quoted context omitted.
Stop it with the "open and porting". They are not going to do it.
I'm not so sure. Chris Lattner was giving some hints around Twitter on how big deal they want to make out of Swift (that is, a ubiquitous systems program). This gives me hope that it'll become open as Clang and ported to other platforms.
Re: Swift 1.2 and Xcode 6.3 beta
#48This might be easily overlooked: optional has been introduced (back-ported?) to Objective-C in the form of nullability annotation!
Re: Swift 1.2 and Xcode 6.3 beta
#49Re: Swift 1.2 and Xcode 6.3 beta
#50Earlier quoted context omitted.
Not exactly. ObjC code cannot usefully benefit from those annotations (yet? more likely ever). At most, it's good for documenting your ObjC code for fellow readers. The actual use appears in the Swiftland where instead of implicitly unwrapped optionals you get proper explicit optionals or explicit non-optionals.
The benefit to working with the Cocoa APIs will be immense, though. I assume that, now that this feature exists, Apple will begin annotating their Obj-C APIs.