Before we can talk about if, case, or any kind of looping, we need to get comfortable with the most fundamental building block of Elixir’s control flow: pattern matching. In a language that treats data as immutable values, the only way to “look inside” a value is by matching its shape against a pattern. The = operator is not an assignment; it is a match operator that attempts to bind variables on the left‑hand side to the corresponding parts of the right‑hand side.
Basic Match: Variables and Literals
A lone variable matches anything:
value = 42 # binds value to