Let’s use the interactive Elixir shell, iex, to look at a really simple piece of code. (Remember, you start iex at the command prompt using the iex command. You enter Elixir code at its iex> prompt, and it displays the resulting values.)
iex> a = 1
iex> a + 3
Most programmers would look at this code and say, “OK, we assign one to a variable a, then on the next line we add 3 to a, giving us 4.”
But when it comes to Elixir, they’d be wrong. In Elixir, the equals sign is not an assignment. Instead it’s like an assertion. It succeeds if Elixir can find a way of making the left-hand side equal the right-hand side. Elixir calls = a match operator.
In this case, the left-hand ...