From: "Randy W. Sims" Date: 2004-09-20T22:52:40+09:00 Subject: Re: Array#index block and rdetect 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. Eg. sets, multisets. Enumerable and Indexable are two different things, though Indexable extends Enumerable.