3 ms·
> a = b can do completely different things depending on where you see it and what declarations are visible and on and on. I don’t see your problem with this. "
by claudius 12y ago
> a = b can do completely different things depending on where you see it and what declarations are visible and on and on.
I don’t see your problem with this. "a + b" certainly can and should do "completely different things depending on where you see it" and "+" is commonly used in completely different contexts in real-world usage, too, e.g. integer addition, integer addition modulo x, real number addition, complex number addition, vector addition, matrix addition, vector space addition, set addition/union etc. etc.
To restrict "+" to only act on integers (or reals?) and require a +_real, +_complex, +_vector, +_matrix etc. seems unreasonable.
Now, given that "+" may well do whatever it seems fit with its two operands, why should "=" not be allowed to do the same?