Project

General

Profile

Actions

Feature #11007

closed

Prime.each.with_index should accept offset

Added by ciel (T Yamada) about 9 years ago. Updated almost 9 years ago.

Status:
Closed
Target version:
-
[ruby-core:<unknown>]

Description

I'd like to execute following code:

Prime.each(10).with_index(1){|e,i|
  print i,' ',e,"\n"
}

Expected output:

1 2
2 3
3 5
4 7

I have attached a patch.


Files

prime.diff (1.09 KB) prime.diff ciel (T Yamada), 03/27/2015 03:10 PM
prime_2.diff (1.2 KB) prime_2.diff ciel (T Yamada), 03/30/2015 07:39 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0