Caleb Clausen wrote:

> On 8/5/05, Nikolai Weibull
> <mailing-lists.ruby-talk / rawuncut.elitemail.org> wrote:

> > Yes, nice analogy ;-).  However, there's a difference between change and
> > plain misuse; operator overloading in C++ comes to mind,

> Ruby lets you override operators too. In fact, you could say in some
> ways it's worse than C++ in this respect, since you can change the
> meaning of adding two integers in ruby....

> I used to believe in very careful operator overloading, and only when
> it preserves the axioms of arithmetic. I disapproved of this:
> "foo"+"bar", because it does not meet that criterion. (Tho I
> recognized that it could be a useful special case.)

I've never thought it bad.  Operators are there to be used on whatever
operands that they are "passed".  My opinion is that it'd be silly to
assume that + can only have one meaning.  Of course, it's a problem that
+ is generally assumed to be commutatitve, which isn't always the case
(String#+ comes to mind),
        nikolai

-- 
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}