From: "alexeymuranov (Alexey Muranov)" Date: 2013-03-02T04:45:51+09:00 Subject: [ruby-core:53088] [ruby-trunk - Feature #7994] Make iterators pass an implicit named parameter `iteration` to the executed block Issue #7994 has been updated by alexeymuranov (Alexey Muranov). Marc-Andre, thanks for the idea, i did not realize that `each_with_index` works with all enumerables. However i was hoping that something like `unless iteration.first?` could be some day optimized away by a compiler to not check on every iteration. I also do not see right away an incompatibility introduced by my second proposal (about the original one you are right). ---------------------------------------- Feature #7994: Make iterators pass an implicit named parameter `iteration` to the executed block https://bugs.ruby-lang.org/issues/7994#change-37238 Author: alexeymuranov (Alexey Muranov) Status: Rejected 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 -- http://bugs.ruby-lang.org/