From: Jacob Fugal Date: 2005-10-06T10:07:49+09:00 Subject: Re: select! not present but reject! is On 10/5/05, David A. Black wrote: > Hi -- > > On Thu, 6 Oct 2005, Jacob Fugal wrote: > > > Is there a reason Array#select! doesn't exist in the core? > > It seems like a strange concept to me. I don't associate > destructiveness with selecting. I guess there would also be find_all! > which seems even stranger :-) > > I know one *can* implement it (i.e., I'm not saying I don't know what > it means). I just don't think that in-place removal of items follows > naturally as a ! version of selecting. Well, maybe select! isn't the right name for it. But as a concept, including the converse of reject! in the core would make sense, at least to me. Maybe with a name like Array#keep!, telling ruby which elements you want to keep and discarding the rest. Jacob Fugal