From: dblack@... Date: 2003-04-25T19:35:41+09:00 Subject: Re: Hashes and Enumerable#each_with_index Hi -- On Fri, 25 Apr 2003, Ryan Pavlik wrote: > On Fri, 25 Apr 2003 07:40:47 +0900 > dblack@superlink.net wrote: > > > Hi -- > > > > On Fri, 25 Apr 2003, Ryan Pavlik wrote: > > > > > > Would it not be more useful to adopt the definiton of > > > Enumerable#each_with_index where the index given is such that e[i] == o > > > for any given Enumerable? > > > > One problem I see is: how could you implement this, in Enumerable, in > > terms of #each? > > > > > I don't see why there must exist a default implementation in > Enumerable... this is a good example of why. I personally have no > preference as to whether it has a new name or not, but I'm guessing > there's little choice since likely a good deal of code already exists > that relies on the current behavior. If it applies to "any given Enumerable", then presumably it's defined in Enumerable :-) David -- David Alan Black home: dblack@superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav