Last active
April 20, 2019 15:54
-
-
Save ScottRadcliff/1ef12047cc183b311432cfe9614ca587 to your computer and use it in GitHub Desktop.
Values in signature
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
defmodule Sample.Signature do | |
def match(1), do: IO.puts "Matched 1" | |
def match(2), do: IO.puts "Matched 2" | |
def match(number), do: IO.puts "Matched #{number} dynamically" | |
end | |
# iex "signature.exs" | |
# Sample.Signature.match(1) | |
# Matched 1 | |
# :ok | |
# | |
# Sample.Signature.match(2) | |
# Matched 2 | |
# :ok | |
# | |
# Sample.Signature.match(22) | |
# Matched 22 dynamically | |
# :ok |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment