Skip to content

Instantly share code, notes, and snippets.

@toranb
Created September 27, 2018 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toranb/7b072896fc307c937dbabd5233374eb8 to your computer and use it in GitHub Desktop.
Save toranb/7b072896fc307c937dbabd5233374eb8 to your computer and use it in GitHub Desktop.
functions defs can have multiple implementations in elixir
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