Unification in Elixir
Pattern matching is a pervasive and powerful tool in Elixir. This isn't too surprising if you know a little about the history of Elixir's parent language, Erlang. Erlang was originally inspired by and written in Prolog, a logic programming language where pattern matching has first-class support.In Elixir, you might see an expression like this:[x, [2, y]] = [1, [2, 3]]When this expression is evaluated, the variables x and y on the left are assigned to values 1 and 3, respectively. The symbol =, c...
Read more at ericpfahl.com