From: Austin Ziegler Date: 2002-10-24T01:08:14+09:00 Subject: Re: Things That Newcomers to Ruby Should Know (10/16/02) On Thu, 24 Oct 2002 00:23:33 +0900, Mills Thomas (app1tam) wrote: >> -----Original Message----- From: Hal E. Fulton >> 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). > But why does it really, REALLY mean that? Was there a reason for > doing this? Is it non-trivial to have '+=' mean 'append()'? It's non-sensical. << exists only as Array#<<, String#<<, and IO#<< and means three different things. Array#<< is the same as Array#push, IO#<< is similar to IO#puts, and String#<< is the same as String#concat. Do you wish to create language exceptions for three classes? How would 1.append(2) work (to use your notation)? Why should there be exceptions to the object/language model in this case? -austin -- Austin Ziegler, austin@halostatue.ca on 2002.10.23 at 12.00.16