From: Rajinder Yadav Date: 2010-11-01T08:58:49+09:00 Subject: Re: the dark side of inherited methods On 10-10-31 07:00 PM, Phillip Gawlowski wrote: > On Sun, Oct 31, 2010 at 11:54 PM, Rajinder Yadav wrote: >> I see how Vector is-a Array, I don't see how Array is-a Vector? I would >> consider collect and collect! to be inconsistent under this definition. > > Array#collect returns a new Array. Array#collect! returns the existing > Array. Thus, Vector#collect returns a new Array, and Vector#collect! > returns the existing Vector. Bang-methods operate on the object > itself, and return the modified object, instead of creating a new > object containing the result of the operation the non-Bang-method > performed. > > The behavior is consistent with how methods with and without Bang operate. > Thanks Phillip, yes I agree with respect to the implementation, i get it. was mulling that over after i hit send =P -- Kind Regards, Rajinder Yadav | DevMentor.org | Do Good! ~ Share Freely GNU/Linux: 2.6.35-22-generic Kubuntu x86_64 10.10 | KDE 4.5.1 Ruby 1.9.2p0 | Rails 3.0.1