Project

General

Profile

Actions

Feature #9140

closed

Allow each_with_index to get start index

Added by rosenfeld (Rodrigo Rosenfeld Rosas) over 10 years ago. Updated over 10 years ago.

Status:
Rejected
Target version:
-
[ruby-core:58496]

Description

Is it possible for array.each_with_index(1){|el, i| ... } to be equivalent to array.each.with_index(1){...}?

Sometimes the application-domain index starts with 1, not 0. Currently each_with_index doesn't accept any arguments, so it wouldn't be backward incompatible if the start index defaults to 0.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0