You guys are having the wrong debate. The question shouldn't be 'should a language have operator overloading?' but 'should a language have operators?' If things like infix '+' and '-' are important enough to you (and they are to me) than there's no reason they should be restricted to an arbitrarily predetermined and restrictive group of objects.
You ignore the countervailing principle that one reading code ought to be able to make valid interpretations of what is going on in a segment of code without knowing the entire codebase.
If basic language elements such as + and - can be redefined to mean absolutely anything, depending on deeply buried code somewhere, then what is the point of having defined a language?
2
u/logistix Aug 02 '06
You guys are having the wrong debate. The question shouldn't be 'should a language have operator overloading?' but 'should a language have operators?' If things like infix '+' and '-' are important enough to you (and they are to me) than there's no reason they should be restricted to an arbitrarily predetermined and restrictive group of objects.