Created
September 27, 2018 12:40
-
-
Save toranb/7b072896fc307c937dbabd5233374eb8 to your computer and use it in GitHub Desktop.
functions defs can have multiple implementations in elixir
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
defmodule Foo do | |
def my_func({name}) do IO.puts("#{name}") end | |
def my_func({name, number}) do IO.puts("#{name} #{number}") end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment