From: Akinori MUSHA Date: 2003-02-03T22:06:53+09:00 Subject: Re: Hash#+ ? At Mon, 3 Feb 2003 21:31:53 +0900, Tom Sawyer wrote: > > On Sunday 02 February 2003 11:25 pm, Akinori MUSHA wrote: > > > What's wrong with 'hash3 = hash1.dup.update(hash2)' ? And I'd like to > > > know how a non in-place version of update is used that frequently. > > > Would you show us some (live) examples? > > by the way, whats wrong with 'arr3 = arr1.dup.concat(arr2)' ? We have live examples that show that Array#+ is useful. Try grepping the source tree for /\+=? *[/. Another reason for Array#+ is that arrays are stackable and a + operator matches our expectation and an analogy to String#+. My question is: would it be so a popular demand to add a new method for Hash? We have been living without it and a.dup.update(b) or {}.update(a).update(b) will do the job if you need the functionality. I'm not really against the idea, but just curious as to how it is going to be used. -- / /__ __ Akinori.org / MUSHA.org / ) ) ) ) / FreeBSD.org / Ruby-lang.org Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp "It went right by me -- At the time it went over my head I was looking out the window.. I should have looked at your face instead"