Project

General

Profile

Actions

Feature #15919

closed

Offset parameter for `Integer#times`

Added by sawa (Tsuyoshi Sawada) almost 5 years ago. Updated over 4 years ago.

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

Description

I request an optional argument on Integer#times to set the offset at start, just like Enumerator#with_index.

5.times(3){|i| p i}
# >> 3
# >> 4
# >> 5
# >> 6
# >> 7

I think there are plenty of use cases, especially when the offset is 1.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0