Issue #15919 has been updated by duerst (Martin D=FCrst).


I agree with all the commenters that using keyword arguments is crucial (an=
d I prefer `start_at:` (or maybe just `start:`) to `offset:`). I also agree=
 that `Integer#step` seems already good enough. Maybe we could add a line a=
bout `Integer#step` in the documentation of `Integer#times`.

----------------------------------------
Feature #15919: Offset parameter for `Integer#times`
https://bugs.ruby-lang.org/issues/15919#change-78597

* Author: sawa (Tsuyoshi Sawada)
* Status: Open
* Priority: Normal
* Assignee: =

* Target version: =

----------------------------------------
I request an optional argument on `Integer#times` to set the offset at star=
t, just like `Enumerator#with_index`.

```ruby
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.



-- =

https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=3Dunsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>