Create a gist now

Instantly share code, notes, and snippets.

defmodule Drop do
def clown1(x) do
5 * x
end
def clown2a(x) do 5 * x end
def clown2b (x) do 5 * x end
def clown2c x do 5 * x end
# iex(77)> Drop.clown2a(5)
# 5
# iex(78)> Drop.clown2a (5)
# 5
# iex(79)> Drop.clown2a 5
# 5
def clown3a(x,y) do x + y end
# def clown3b (x,y) do x + y end # syntax error
def clown3c x,y do x + y end
# iex(80)> Drop.clown3a(5,6)
# 11
# iex(81)> Drop.clown3a (5,6)
# ** (SyntaxError) iex:81: unexpected parentheses. If you are making
# a function call, do not insert spaces between the function name
# and the opening parentheses. Syntax error before: '('
#
# iex(81)> Drop.clown3a 5,6
# 11
# def clown4a(x,y), do: x + y end # syntax error
def clown4b(x,y), do:
x + y
# def clown4c(x,y), do:x + y # syntax error
# def clown4e x,y, do: x + y # syntax error
def clown4f(x,y) , do: x + y
def clown4g(x,y) ,do: x + y
# def clown4h(x,y) , do : x + y # syntax error
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment