Hi --

On 18/10/2007, JeremyWoertink / gmail.com <JeremyWoertink / gmail.com> wrote:
> awesome. So what does the 0..-2 do? how does that work exactly?

When you use array subscripts starting from -1, -2, -3, etc, it starts
to look at the _end_ of the array going backwards.  So for instance:

>> a=[1,2,3]
=> [1, 2, 3]

>> a[-1]
=> 3

When you want a range inclusive of something, but not all the way to
end, you can tell it to stop off at a subscript which is relative to
the array's size.  Since you didn't want the last element but
everything before it, that's -2 as an array subscript counting
backwards:

>> a[0..-2]
=> [1, 2]

-- Thomas Adam