From: James Edward Gray II Date: 2006-02-06T00:52:19+09:00 Subject: Re: Ruby feature request - enum.detect_index On Feb 5, 2006, at 9:48 AM, Robert Klemme wrote: > Yukihiro Matsumoto wrote: >> Hi, >> In message "Re: Ruby feature request - enum.detect_index" >> on Sun, 5 Feb 2006 23:43:19 +0900, "jonT" writes: >>> detect works great but doesn't supply the index of the match. It >>> would be nice to have a method detect_index that returned the index >>> rather than the object. >> Nice idea. I'd rather name it 'find_index' though. > > Don't we have that already? > >>> %w{foo bar baz}.index "baz" > => 2 > > Or am I missing something? You can not use a block of Ruby code to select the item you would like an index for, in this example. James Edward Gray II