From: Rick DeNatale Date: 2009-12-23T00:04:53+09:00 Subject: Re: select! On Tue, Dec 22, 2009 at 9:54 AM, Roger Pack wrote: > >> For consistency's sake, I'd still suggest the standard library should >> provide >> something like: >> >> module Enumerable >>   def select! >>     reject! {|*args| ! yield(*args) } >>   end >>   def reject! >>     select! {|*args| ! yield(*args) } >>   end >> end -1 Enumerable does not have a reject! since not all Enumerables are mutable either in general or during enumeration. Also the given suggestion would lead to infinite loops, unless reject! or select! was overridden in the including class. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale