Project

General

Profile

Actions

Feature #7994

closed

Make iterators pass an implicit named parameter `iteration` to the executed block

Added by alexeymuranov (Alexey Muranov) about 11 years ago. Updated about 11 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:53072]

Description

=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

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0