Following a discussion on ruby-talk of a few ideas for ruby[1], thought I'd suggest them (one at a time) to core. Here's the first. Add an Object#in? method to complement Enumerable#include? Background: currently if you want to test for membership you have to do it "backward" by using include? on the array. ex: if STUFF.include?(a) puts 'yes' else puts 'no' end Clearer to the reader (at least to my eyes) would be if a.in?(STUFF) puts 'yes' else puts 'no' end proposed definition (from [3]) module Kernel # Is self included in other? # # 5.in?(0..10) #=> true # 5.in?([0,1,2,3]) #=> false # def in?(other) other.include?(self) end end currently several developers said they use this idiom already [1,2,3], facets has it, and I have found it quite useful in the past, therefore propose its incorporation into core. drawbacks: existing 'in?' methods would become ambiguous--I'd imagine this is rare so hopefully a limited impact. Thoughts? Thanks. -=r [1] http://www.ruby-forum.com/topic/184011 [2] http://snippets.dzone.com/posts/show/3516 [3] http://facets.rubyforge.org/doc/api/core/classes/Kernel.html#M000425