Live data from Hacker News

Swift 1.2 and Xcode 6.3 beta

developer.apple.com

41–50 of 94 posts

Re: Swift 1.2 and Xcode 6.3 beta

#41

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 borrowed "if let" from Rust, not the other way around.

Re: Swift 1.2 and Xcode 6.3 beta

#42

This 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.

Re: Swift 1.2 and Xcode 6.3 beta

#43
post #37

How 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.

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

#44

This 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.

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.

Re: Swift 1.2 and Xcode 6.3 beta

#45
post #19
post #9

Why 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.

That doesn't seem to be the case. I just made a free account quick to test this, and it won't let me access the betas without being a member of the paid iOS developer program.

Re: Swift 1.2 and Xcode 6.3 beta

#46

Earlier 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.

"The if let construct is based on the precedent set by Swift,"

https://github.com/rust-lang/rfcs/blob/master/text/0160-if-l...

Re: Swift 1.2 and Xcode 6.3 beta

#47
post #37

Earlier 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.

Just like FaceTime. It won't happen and all the rumors and gossip based on a few comments will just give false hope to people. Swift was designed to lock-in developers just when objcjava converters were gaining popularity.

Re: Swift 1.2 and Xcode 6.3 beta

#49
post #46

Earlier quoted context omitted.

Swift borrowed "if let" from Rust, not the other way around.

"The if let construct is based on the precedent set by Swift," https://github.com/rust-lang/rfcs/blob/master/text/0160-if-l...

Wow. Such a rapid feedback loop here. Thanks for sharing.

Re: Swift 1.2 and Xcode 6.3 beta

#50

Earlier 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.

They already started doing it a few months ago with private annotations. This "nonnull"/"nullable" syntax is a result of their work on annotating Cocoa APIs.
Post reply on HN