From: "David A. Black" Date: 2009-12-24T08:19:44+09:00 Subject: [ruby-core:27301] Re: select! Hi -- On Mon, 21 Dec 2009, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: [ruby-core:27242] select!" > on Sun, 20 Dec 2009 13:22:11 +0900, Roger Pack writes: > > |Is there any reason there's no select! > > Enumerables cannot have bang method, since they are not always > mutable. The reason we don't have Array#select! is that I feel the > word select means picking up elements, not removing non-selecting > elements. But I once felt same way to map! and (English speaking) > people persuaded me, so same thing could happen on select! as well. I agree with you. The idea of a destructive select makes no sense to me. Selecting implies that there's a result set that's separate from the original collection. "keep" might be a better name for an operation that's a kind of reverse reject!. David -- David A. Black Senior Developer, Cyrus Innovation Inc. THE COMPLEAT RUBYIST, Ruby training with Black/Brown/McAnally! January 22-23, Tampa, Florida Info and registration at http://www.thecompleatrubyist.com