From: Paul Brannan Date: 2001-10-22T23:18:48+09:00 Subject: [ruby-talk:22964] Re: modified assignments with methods? On Mon, 22 Oct 2001, Yukihiro Matsumoto wrote: > Hi, > > In message "[ruby-talk:22919] modified assignments with methods?" > on 01/10/22, "Mark Hahn" writes: > > |then why can't > | > | arr1 = arr1.concat arr2 > | > |be written as > | > | arr1 concat= arr2 > | > |??? > | > |The syntax is unambiguous and this would be very logical. > > I agree with the concept, but I'm not sure if there's proper syntax > for it. > > matz. More appropriate, I think, are the "bang methods". For example, where you might want to write: str gsub= 'a', 'b' it would be more appropriate to write: str.gsub!('a', 'b') There is no Array#concat!, but there is an Array#<<, which works well. Paul