Created
November 8, 2015 15:18
-
-
Save llaisdy/72390569186934071a7c to your computer and use it in GitHub Desktop.
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 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