From: Hugh Sasse Staff Elec Eng Date: 2000-07-26T10:26:08+01:00 Subject: [ruby-talk:04217] 1.4 manual: Array.html: suggested patches. I would like to suggest the following patches for Array.html in the ruby-1.4 documentation set. Principally these are to improve navigation within the file, but also to show that "..." ranges may be used in Array expressions. Hugh hgs@dmu.ac.uk --- Array.html.orig Fri Oct 15 01:46:35 1999 +++ Array.html Wed Jul 26 10:21:06 2000 @@ -69,24 +69,38 @@ array. The index of the last element is -1. Returns nil, if the nth element is not exist in the array.

-
self[start..end] +

+See also +self[nth] = val. +

+
+self[start..end]

Returns an array containing the objects from start to -end, including both ends. if end is larger than -the length of the array, it will be rounded to the length. If -start is out of an array range , returns nil. -And if start is larger than end with in array -range, returns empty array ([]). +end, including both ends. If ... is used (instead +of ..), then end is not included. if end +is larger than the length of the array, it will be rounded to the +length. If start is out of an array range , returns +nil. And if start is larger than end +with in array range, returns empty array ([]).

- -
self[start, length] +

+See also +self[start..end] = val. +

+
+self[start, length]

Returns an array containing length items from start. Returns nil if length is negative.

+See also +self[start, length] = val. +

+

self[nth] = val
@@ -96,21 +110,36 @@ extended automatically. Extended region shall be initialized by nil.

-
self[start..end] = val +

+See also +self[nth]. +

+
+self[start..end] = val

Replace the items from start to end with -val. If val is not an array, the type of -val will be converted into the Array using +val. If ... is used (instead of ..) +then end is not included. If val is not an array, +the type of val will be converted into the Array using to_a method.

-
self[start, length] = val +

+See also +self[start..end]. +

+
+self[start, length] = val

Replace the length items from start with val. If val is not an array, the type of val will be converted into the Array using to_a. +

+

+See also +self[start, length].

Example: