News for hackers. Stuff that matters.
Re:Swift 1.2 and Xcode 6.3 beta by wyager on Monday February 09, 2015 @09:46PM (#9025111)
With generalized pattern matching, your code could (among other things) take the form of

    case result of
        Just x -> <do something with x>
        Nothing -> <do something without x>
This works with optionals as well as any other algebraic data type.
Re:Swift 1.2 and Xcode 6.3 beta by archagon on Monday February 09, 2015 @10:09PM (#9025176)
I'm not sure if this is the case in your example, but at least in Swift, the "if let" block or chaining for optionals is mandatory. This should mean that it's impossible to have a dangling/null pointer unless you use the force dereference operator. (And that's something that should almost never appear in your code!) You don't get the choice of being lazy or forgetting about checking your pointers: it's a conscious decision either way.

Personally, I appreciate that the language naturally makes me organize my code better and more safely.

Re:Swift 1.2 and Xcode 6.3 beta by masklinn on Tuesday February 10, 2015 @03:55AM (#9026035)
It is, and you can pattern-match Optional in Swift, something along the lines of

    switch optional {
    case .Some(let numeral):
        println("Caught a \(numeral)")
    default:
        println("Nothing to catch")
    }