Only modules
defmodule Calc do
def sum(a, b) do
a + b
end
end
# And we call it elsewhere as:
# Calc.sum(2, 3)
# => 5
# In Elixir, the = operator is actually called the match operator
iex> x = 1
1
iex> 1 = x
1
iex> 2 = x
** (MatchError) no match of right hand side value: 1
# In Elixir, the = operator is actually called the match operator
iex> x = 1
1
iex> 1 = x
1
iex> 2 = x
** (MatchError) no match of right
hand side value: 1