Elixir has borrowed the pattern matching approach from Erlang, but allows rebinds which makes code refactoring easier.
iex(1)> x = 1 1 iex(2)> x = 2 2 iex(3)> ^x = 3 (MatchError) no match of right hand side value: 3
Notice the pin operator (^) to achieve the same effect.