From: Srijayanth Sridhar Date: 2008-07-01T19:46:41+09:00 Subject: Re: Hash#select returns an array but Hash#reject returns a hash... irb(main):001:0> a=Hash.new => {} irb(main):002:0> a[1]=2 => 2 irb(main):003:0> a[2]=2 => 2 irb(main):004:0> a[3]=4 => 4 irb(main):005:0> a.select { |key,value| value > 2 } => [[3, 4]] irb(main):006:0> a.reject { |key,value| value <= 2 } => {3=>4} On Tue, Jul 1, 2008 at 4:09 PM, Dave Bass wrote: > Srijayanth Sridhar wrote: >> Is there any design reason for select returning an array and reject >> returning a hash? Why this disparity? > > In module Enumerable, both select and reject return an array (according > to the Pickaxe). > -- > Posted via http://www.ruby-forum.com/. > >