On 25-Jun-06, at 3:58 PM, Wouter de Bie wrote:

> Simen Edvardsen wrote:
>> That's because operator overriding isn't an extension of the
>> semantics, but the syntax. Perhaps the documentation ought to make
>> that clear.
>
> I agree with that. The documentation should note that << only  
> overloads
> or defines the method called "<<", but does not overloads or redefines
> the syntax of <<. Ofcourse the same goes for other operators like +  
> and
> -. On the other hand, ruby only gives a syntax error when calling the
> method and doesn't warn the programmer when defining the method. I  
> think
> it's logical that ruby warns when programmer when the method is  
> defined,
> since the example I give on top is completely unuseful.

Why would you want it to warn you when you're defining it? You assume  
that it'll know how you want to use it, which it cannot know that.

--
Jeremy Tregunna
jtregunna / blurgle.ca


"One serious obstacle to the adoption of good programming languages  
is the notion that everything has to be sacrificed for speed. In  
computer languages as in life, speed kills." -- Mike Vanier