Am 05.03.2013 18:07, schrieb Jack R.:
> I agree that if you take "at the end" to mean "the index *following* the
> last valid element" that the behavior becomes consistent.  Then I guess
> that should be stated, since that is one of many possible
> interpretations of "at the end" (the most obvious one to me would "the
> index of the last valid element").

Well, when "at the end" would mean here the last valid index,
then it would not make any sense to return an empty array...

And you have to see "end of the array" in the context of the
previous sentence:
"For start and range cases the starting index is just before an
element.  Additionally, an empty array is returned when the starting
index for an element range is at the end of the array."

The same principle is used for element assignment, to enable
insertion before the first or after the last element:

2.0.0-p0 :001 > a = [0, 1, 2]
  => [0, 1, 2]
2.0.0-p0 :002 > a[3,0] = "B"; a
  => [0, 1, 2, "B"]
2.0.0-p0 :003 > a[0,0] = "A"; a
  => ["A", 0, 1, 2, "B"]


> In the end, examples should help solve all this, and I did not look
> closely enough at the examples, so shame on me.

-- 
<https://github.com/stomar/>