On Mar 18, 2008, at 12:09 PM, David Flanagan wrote:

>> I'd like to see member? do what it's name suggests and work on a  
>> set-like basis, so that
>>  (1..3).member?(2) => true
>>  (1..3).member?(2.5) => false
>> Dave
>
> IIRC, there was a long ruby-core thread about the name of the cover?  
> method. Perhaps that thread will offer some insight into this issue.

I think cover? is fine. But I feel member? is wrong, as it evokes set  
membership, and yet returns true for elements not in the set.

If (1..3).member?(2.5) returns true, then why doesn't  
('a'..'b').member?('az') also return true (and I mean philosophically,  
not in terms of implementation)?

As I said in another thread, over the last 8 years I've tried to give  
feedback when writing the PickAxes. I sometimes find things when  
writing which seem to require more explanation than seems reasonable,  
or that requires a degree of hand waving that makes me uncomfortable.  
This is one of those cases.

I report them as a way of spurring some discussion. Sometimes Ruby is  
changed as a result, and sometimes it isn't.


Cheers


Dave