From: "James F.Hranicky" Date: 2003-08-27T07:22:51+09:00 Subject: Re: Array#uniq! On Wed, 27 Aug 2003 05:52:06 +0900 Hal Fulton wrote: > I've thought about these issues, too... I usd to be bitten frequently > by the nil-return bug^H^H^H feature. But then I just fell out of the > habit of chaining certain methods. > > I never use the fact that they return nil. Hmmm...what if they could take an argument that allowed the user to explicitly return the receiver? : arr.sort!(1).uniq!(1).each { |e| ... } Kinda busy...what about a = Array.new a.bang_returns_receiver = true or a = Array.new a.bang_returns_nil_if_receiver_not_modified = true making the return of the receiver the default (better method names would be good :->). Ultimately, I guess I still don't see how modifying the receiver is more dangerous than making a copy unless somehow a.sort!.uniq!.each { |e| ... } would give you a different list of elements than a.sort.uniq.each { |e| ... } OTOH, I haven't run into a case where making copies has given me any problems. Jim