Skip to content

Instantly share code, notes, and snippets.

@tonyc
Created March 17, 2019 15:18
Show Gist options
  • Save tonyc/904e653faa1eaf66a4901e47513eeb77 to your computer and use it in GitHub Desktop.
Save tonyc/904e653faa1eaf66a4901e47513eeb77 to your computer and use it in GitHub Desktop.
multiclause lambda
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