Issue #10944 has been updated by nagachika (Tomoyuki Chikanaga).
Backport changed from 2.2: DONE, 2.3: DONE, 2.4: REQUIRED to 2.2: DONE, 2.3: DONE, 2.4: DONE
ruby_2_4 r58629 merged revision(s) 58037.
----------------------------------------
Bug #10944: Documentation of Array.new w.r.t. element index available to a block
https://bugs.ruby-lang.org/issues/10944#change-64717
* Author: dgc (Don Cruickshank)
* Status: Closed
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.0.0p353 (2013-11-22 revision 43784) [i386-linux]
* Backport: 2.2: DONE, 2.3: DONE, 2.4: DONE
----------------------------------------
In http://ruby-doc.org/core-2.2.1/Array.html#class-Array-label-Creating+Arrays
The documentation for the Array.new method is missing the fact that the element index is available to a given block.
E.g.
Array.new(4) { |x| x } #=> [0, 1, 2, 3]
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>