From: Christian Szegedy Date: 2001-05-15T23:50:33+09:00 Subject: [ruby-talk:15166] operator idea I like the feature of Ruby that automatically generates the operator += from +. It is exactly right for the simplicity of use. On the other hand, for the performance, it could make sense to do it the in other way round: Allowing the definition of +=() which automatically generates the operator +(). In most cases it would be much more effective: for example for the case of x=a+b+c+d+e the parser could generate the calls: x=a.dup; x+= b; x+= c; x+= d; x+= e; and could eliminate a lot of allocations. Or for example look at the benchmarks at You can see how suboptimal the current += operator performs for strings in the example: for i in 1 .. n str += "hello\n" end I don't think it's too late: One could preserve the current mechanism, but also enable the definition of += operator which would override the original + operator. So one would have both compatibility and could boost speed in a lot of situations. Just an idea... Best regards, Christian