Why Does “=” Mean Assignment?
Another interesting way to think about it is as &quot;match&quot;. That is try to match the stuff on the right with the stuff on the left.<p>Take Erlang for example:<p><pre><code>    1&gt; X = 1.
    1
    2&gt; X = 2.
    ** exception error: no match of right hand side value 2
</code></pre>
Notice variables are immutable (not just values themselves). Once X becomes 1, it can only match with 1 after that. You might think this is silly or annoying, why not just allow reassignment and instead have to sprinkle X1, X2 everywhere. But it turns out is can be nice because it makes state updates very explicit. In complicated applications that helps understand what is happening. And it behaves like you&#x27;d expect in math, in the sense that X = X + 1 doesn&#x27;t make sense here either:<p><pre><code>    1&gt; X = 1.
    1
    2&gt; X = X + 1.
    ** exception error: no match of right hand side value 2
    3&gt;    
</code></pre>
It does pattern matching very well too, that is, it matches based on the shape of data:<p><pre><code>    1&gt; {X,Y} = {1,2}.
    {1,2}
    2&gt; X.
    1
    3&gt; Y.
    2
    4&gt;
</code></pre>
In other languages we might say we have assignment and destructuring but here it is rather simple it&#x27;s just pattern matching.