From: Joel VanderWerf Date: 2013-09-18T10:38:08-07:00 Subject: [ruby-core:57268] Re: [ruby-trunk - Feature #8921][Open] Allow select, reject, etc to accept a regex On 09/18/2013 09:17 AM, Fuad Saud wrote: > I mean, couldn't select, reject and friends take one parameter in case > no block is passed and compare elements using the threequals operator. > This would enable one to do things like: > > [1, 56, 12, 7, 39].select 0..20 #=> [1, 12] > %w( foo bar baz ).reject /^ba/ #=> [foo] And then, because of Proc#===, there is this symmetry: >> big = proc {|x| x>10} => # >> [1,2,34].select &pr => [34] >> [1,2,34].select pr => [34] # with proposed change