Comment by SeanDav
It is not a lie it is just apparently familiar notation that actually has an entirely different meaning. It is not an equation, it is an assignment.
X := X + 1 is perhaps less confusing, even if meaning the same thing.
It is not a lie it is just apparently familiar notation that actually has an entirely different meaning. It is not an equation, it is an assignment.
X := X + 1 is perhaps less confusing, even if meaning the same thing.
That's exactly right. Looking at the Assignment Operator Wiki page, it's also clear where these notations come from.
I think an easy way to look at it, for someone coming from a math background, is to think of programming lines as instructions, instead of statements. x=x+1 can be then read as "let x be x+1", and that's it.
Although in Erlang it's closer to an equation with assignment being a side effect. `=` is the pattern matching operator.