Last active
August 29, 2015 14:24
-
-
Save wsmoak/eb4856f27a2b958fc46e 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
In this bit of http://elixir-lang.org/getting-started/case-cond-and-if.html | |
Clauses also allow extra conditions to be specified via guards: | |
iex> case {1, 2, 3} do | |
...> {1, x, 3} when x > 0 -> | |
...> "Will match" | |
...> _ -> | |
...> "Won't match" | |
...> end | |
"Will match" | |
... shouldn't the 5th line (line # 9 above) be "Would match" since _ always matches, | |
it just won't get the chance in this case because line 6 matched first? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment