From: matz@... (Yukihiro Matsumoto) Date: 2002-11-26T12:43:08+09:00 Subject: Re: each_with_index & collect_with_index? Hi, In message "each_with_index & collect_with_index?" on 02/11/26, Tim Bates writes: |Array.each (and others) have an alternative .each_index which passes the index |to the element instead of the element itself to the block. Is there an easy |way to pass both the index and the element, eg something like |Array.each_with_index{ |i, el| ... } We already have this one. |Also, an equivalent for these in 'collect' could be useful, eg |Array.collect_index{ |i| ... } |Array.collect_with_index{ |i, el| ... } These ideas are proposed several times. But no one ever succeeded to persuade me to add these. Do you think of any concrete usage of these methods, not just for seeking completeness? matz.