On Oct 28, 2005, at 1:07 PM, Trans wrote:
> Case in point, what's the english equiv of #===. I'd really like to
> have one.
>

How about "contains" or "includes"?

     String contains "abc"
     0..10 contains 5
     1,2,3,4 contains 3
     /^[a-z]*$/ includes "apple"

It would be nice if Array#=== was aliased to Array#include?  So that

     somearray === someval

would check for membership.  You can "cheat" a bit with the case
statement as follows:

     a = [1,2,3,4]
     b = 3

     case b
     when *a
       puts "match"
     else
       puts "no match"
     end

This works with any object that responds to to_a but of course
requires that an array be constructed instead of a more efficient
lookup into the object that could be done via a
customized === method.

See my recent posting about this (ruby-talk:162999)