From: Yukihiro Matsumoto Date: 2004-09-20T12:19:44+09:00 Subject: Re: Array#index block and rdetect Hi, In message "Re: Array#index block and rdetect" on Mon, 20 Sep 2004 11:12:12 +0900, "David A. Black" writes: |> * Enumerable#each_index should be removed (yes/no) | |There is no Enumerable#each_index -- nothing to remove. I meant each_with_index. |> * How about other enumerable classes? | |I think the idea of every enumerable class having an "index", defined |as part of that class, is possibly useful. For hashes it could be the |keys; for arrays, the integer index; for files, the line number. In |some cases (like index/key for hashes), it might be redundant. But it |might open up some good possibilities. The most consistent (but incompatible) change would be: * leave Enumerable#each_with_index unchanged. * make Hash#each as alias of Hash#each_value * redefine Hash#each_with_index as alias of Hash#each_pair But this change may break many programs. matz.