From: Roger Pack Date: 2010-03-02T04:34:51+09:00 Subject: [ruby-core:28388] [Feature #2515](Open) Array#select! Issue #2515 has been updated by Roger Pack. Status changed from Rejected to Open Hmm. I personally have had uses for select! in the past, as others have as well. http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/27316 http://www.ruby-forum.com/topic/200640#875371 Currently we are forced to use reject! which is surprising... Think of select! as a destructive version of select, which currently doesn't exist in the std lib. For example if you have this (albeit trivial) example : a = some_large_array c = a.select{|b| b%2 == 1} and then want to change this to a destructive select to the array, because it is very large, the first thing you try is a.select!{|b| b %2 == 1} But it surprisingly doesn't exist (reject has its destructive counterpart, map does too, but select doesn't), so you are forced to rewrite your boolean logic to use reject! a.reject!{|b| (b%2) != 3} which can be less readable, but more importantly--it is surprising to have to do so, at least to me. It would be more convenient and less surprising to have a select! Reopening. Thanks. -rp ---------------------------------------- http://redmine.ruby-lang.org/issues/show/2515 ---------------------------------------- http://redmine.ruby-lang.org