Swift Switch Where Filter

好吧,swift这回要逆天了

let yetAnotherPoint = (1, -1)
switch yetAnotherPoint {
case let(x, y) where x == y:
    println("(\(x), \(y)) is on the line x == y")
case let(x, y) where x == -y:
    println("(\(x), \(y)) is on the line x == -y")
case let(x, y):
    println("(\(x), \(y)) is just some arbitary point")
}

ref: The Swift Programming Language