Last active
October 10, 2015 08:44
-
-
Save dolphinsue319/fc4e1ce9d130f4e12378 to your computer and use it in GitHub Desktop.
用 switch 語法解決 <>== 0 的問題
This file contains hidden or 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 x = 1 | |
switch x { | |
case _ where x > 0: | |
print("> 0") | |
case _ where x < 0: | |
print("< 0") | |
default: | |
print("== 0") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment