On Tue, Aug 10, 2004 at 03:46:17PM +0900, Robert Klemme wrote: > Hm, sounds to me like it was not general enough to include it in > Enumerable. Before I see that method I'd prefer to have size and empty? > in Enumerable. Just my 0.02 EUR... personally the idea of having a method taking 4 procs in the stdlib is just a bit strange. i'd prefer to see a generic set of methods that are somehow mixedin to the values that a Enumerable yields, therefore allowing things like val.last? or first? or even a generic val.enum_index to replace the each_with_index rubbish. i've no idea how to solve this neatly unfortunately as extend'ing the objects that are yield'ed of course will have sideeffects... though most of the side effects that will cause problems shouldn't happen at all, e.g people calling is_a? a lot will have problems... i do this and yet i don't have an exception to such an extension... but this: blah.each { |element| pos = blah.index element puts blah[pos-1] puts element } is soooooo uggllyyy... not to mention inefficient... i'd just loooveeee to see a element.previous_in_enum... cheers, Alex