From: "David A. Black" Date: 2004-09-20T23:52:08+09:00 Subject: Re: Array#index block and rdetect Hi -- On Mon, 20 Sep 2004, Randy W. Sims wrote: > David A. Black wrote: > > Hi -- > > > > On Mon, 20 Sep 2004, Yukihiro Matsumoto wrote: > > > >> * 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. > > > > That would mean an enumerable class would have to be able to say: > > "This is how I define 'index'." I'm not sure how that would work. > > All enumerable objects don't neccessarilly have a meaningful concept of > an index. I know. That's why I've been advocating the removal of Hash#each_with_index for four years :-) David -- David A. Black dblack@wobblini.net