From: Alex Young Date: 2013-03-02T00:31:26+09:00 Subject: [ruby-core:53074] Re: [ruby-trunk - Feature #7994][Open] Make iterators pass an implicit named parameter `iteration` to the executed block On 01/03/13 15:21, alexeymuranov (Alexey Muranov) wrote: > > Issue #7994 has been reported by alexeymuranov (Alexey Muranov). What advantages does this have over: items.drop(1).each do |item| or items[1..-1].each do |item| or to invert it: items.first.tap do |item| ? -- Alex > > ---------------------------------------- > Feature #7994: Make iterators pass an implicit named parameter `iteration` to the executed block > https://bugs.ruby-lang.org/issues/7994 > > Author: alexeymuranov (Alexey Muranov) > Status: Open > Priority: Normal > Assignee: > Category: > Target version: > > > =begin > I think it would be nice to be able to write something like this: > > items.each do |item| > unless iteration.first? > # do something that is not applicable to the first iteration > end > # do whatever is to be done to all items > end > =end > > >