Created
March 17, 2019 15:18
-
-
Save tonyc/904e653faa1eaf66a4901e47513eeb77 to your computer and use it in GitHub Desktop.
multiclause lambda
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
iex(3)> test_num = fn | |
x when is_number(x) and x < 0 -> | |
:negative | |
0 -> :zero | |
x when is_number(x) and x > 0 -> | |
:positive | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment