From: George Ogata Date: 2004-07-06T08:52:40+09:00 Subject: Re: Array::index and rindex operator Hadmut Danisch writes: > Hi, > > the Array::index and rindex functions > > arr.index( anObject ) -> anInteger or nil > Return the index of the first/last object in arr such that the > object == anObject. Returns nil if no match is found. > > > > Wouldn't it be better to have > > such that anObject === object ? I'm not so sure about that; #=== is primarily meant for case statements, and very few methods use it like the way you propose. It would also separate it from other Array/Enumerable methods like #find, #delete, #include?, etc. Sometimes though I wish that #index could take a block (i.e., return the first index for which the block is true). Unless I'm overlooking something, there doesn't seem to be a method that does this. I don't know what others think of the idea, but that would probably go some way towards your goal.