From: Mike Leddy Date: 2011-06-18T00:00:27+09:00 Subject: [ruby-core:37199] Surprised by Array#delete_if in Ruby 1.9.2 Hello, Being familiar with the use of Array#delete and Array#delete_at which return the item deleted I was somewhat surprised by the behaviour of Array#delete_if returning the resultant array and NOT an array of the items that were deleted. I would like to argue that it should return the items that are deleted: + Maintain similarity with Array#delete, and Array#delete_at "principle of least surprise" + To really be the complement of Array#keep_if which "correctly" returns the array that is 'kept'. + Writing code that achieves the same effect is a little difficult to read and requires another variable (using parallel assignment + Enumerator#partition) eg: b, a = a.partition {|x| x%2==0} Anyone else agree ? Thanks, Mike