From: Gavin Sinclair Date: 2002-10-24T00:51:54+09:00 Subject: Re: Things That Newcomers to Ruby Should Know (10/16/02) From: "Mills Thomas (app1tam)" > But why does it really, REALLY mean that? Was there a reason for doing > this? Is it non-trivial to have '+=' mean 'append()'? > > Drew It's just the way it is. In C++, the following are separate overloadable operators: =, +, and +=. In Ruby, = is not overloadable, + is, and += is not even an operator. I think Ruby's way makes sense. In C++ it is possible for + and += to be semantically incompatible. Or for + to be valid and not +=. If performance is what you're worried about, inlining += is not the place to start. Cheers, Gavin > > From: Hal E. Fulton [mailto:hal9000@hypermetrics.com] > > > > It's a feature. :) The notation a+=b really, REALLY > > means a = a + b. There is a + operator, but never a > > += operator, in Ruby (or any other assignment). > > > > Hal