From: Jacob Fugal Date: 2005-10-06T06:18:59+09:00 Subject: Re: select! not present but reject! is On 10/5/05, Gene Tani wrote: > Can you use Enumerable#partition ? > > Geert Fannes wrote: > > Hello, is there a reason why I can find the in-place mutator method > > Array#reject! and not Array#select! ? It is ofcourse easy to add this > > method but it is my feeling this should be added to the core. That's beside the point, for two reasons: 1) Geert's question is regarding the lack of symmetry between the presence of Array#reject! but absence of Array#select!.[1] 2) Geert is interested in in-place mutators (Array#reject!, Array#select!). Enumerable#partition returns two new Arrays; it is not an in-place mutator. As far as work-arounds, this would probably be closest: class Array def select! self.reject! { |e| not yield e } end end But I'm sure Geert is already aware of this (or a better version). Geert's question, to which I would like an answer as well, is this: Is there a reason Array#select! doesn't exist in the core? Jacob Fugal