Created
June 11, 2014 14:41
-
-
Save hartbit/50cea01c4f70649cf89a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 arbitrary point") | |
} | |
// prints "(1, -1) is on the line x == -y" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment