From: Ian Macdonald Date: 2002-10-22T12:30:19+09:00 Subject: Re: Things That Newcomers to Ruby Should Know (10/16/02) On Tue 22 Oct 2002 at 12:18:22 +0900, Hal E. Fulton wrote: > ----- Original Message ----- > From: "Ian Macdonald" > To: "ruby-talk ML" > Sent: Monday, October 21, 2002 10:03 PM > Subject: Re: Things That Newcomers to Ruby Should Know (10/16/02) > > > > Hmm, why does 'string += another' need to create a new object? string > > already exists, so wouldn't the reference simply be updated? > > It's a feature. :) The notation a+=b really, REALLY > means a = a + b. I understand that, but since 'a' already exists prior to assigning a + b to it, why does it need to be recreated? Where strings are concerned, I don't see why this would be any different to 'a << b'. I don't doubt for a minute that I'm being told the truth here; I just fail to understand why this way of doing things is necessarily less efficient. Ian -- Ian Macdonald | Cocaine: The thinking man's Dristan. ian@caliban.org | | | |