From: Charles Oliver Nutter Date: 2009-05-26T05:08:44+09:00 Subject: [ruby-core:23555] Re: a feature for ruby: Kernel#in? Roger Pack wrote: > 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. The very strong argument against this is that membership in a collection is not a property of the objects in the collection, so having an "in?" method doesn't really make sense. It's also trivial to just define an "in?" yourself that calls "include?" so it seems unnecessary to pollute every object in the system with "in?". - Charlie