On Sep 6, 7:52=A0pm, "Aaron D. Gifford" <astound... / gmail.com> wrote:
> Just move things around a bit and you'll notice you've already got the
> behavior you want (or pretty close):
>
> irb(main):001:0> arr =3D [0,1,2,3,4]
> =3D> [0, 1, 2, 3, 4]
> irb(main):002:0> [0..-2, -1].map{|i| arr[i]}
> =3D> [[0, 1, 2, 3], 4]
> irb(main):003:0> [0, 2..3, 4..-1].map{|i| arr[i]}
> =3D> [0, [2, 3], [4]]
>
> So just put the list of group selectors first, execute a map/collect
> on it and access the original array slices you want.
>
> Aaron out.

Ah, of course. Thanks.