Issue #7994 has been updated by marcandre (Marc-Andre Lafortune).


> I also do not see right away an incompatibility introduced by my second proposal (about the original one you are right).

  #before
  [[1,2]].each{|a, b| p a, b} # => 1, then 2
  # after
  [[1,2]].each{|a, b| p a, b} # => [1, 2], then<#your iteration object>

BTW, all hashes would be affected like this!
----------------------------------------
Feature #7994: Make iterators pass an implicit named parameter `iteration` to the executed block
https://bugs.ruby-lang.org/issues/7994#change-37240

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/