Issue #6680 has been updated by stomar (Marcus Stollsteimer).

File typo_in_rdoc_for_array_and_string_slice.patch added

Hi Eric,

there is a typo in the new examples, see new patch:

in the "special cases", a[6] (which is already given as example a couple
of lines above) should be a[6, 1], to show the difference between
a[a.size, length], which is a valid range, and a[a.size + 1, length],
which is not in valid range.

----------------------------------------
Bug #6680: Unclear rdoc for Array and String slicing
https://bugs.ruby-lang.org/issues/6680#change-27806

Author: stomar (Marcus Stollsteimer)
Status: Closed
Priority: Normal
Assignee: drbrain (Eric Hodel)
Category: DOC
Target version: 2.0.0
ruby -v: ruby 1.9.3p243 (2012-06-28 revision 36244) [i686-linux]


=begin
Slicing of arrays and strings specifying start/length or using a range is not documented well, and often leads to confusion, see for example

<http://stackoverflow.com/questions/3568222/array-slicing-in-ruby-looking-for-explanation-for-illogical-behaviour-taken-fr>

or

<http://www.ruby-forum.com/topic/1393096#990065>

The attached patch tries to clarify the documentation.
=end



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