int end = (int)jv_number_value(end_jv);
if (start < 0) start = len + start;
if (end < 0) end = len + end;
+
if (start < 0) start = 0;
+ if (start > len) start = len;
if (end > len) end = len;
if (end < start) end = start;
+ assert(0 <= start && start <= end && end <= len);
*pstart = start;
*pend = end;
return 1;
# Slices
#
-[.[3:2], .[-5:4], .[:-2], .[-2:]]
+[.[3:2], .[-5:4], .[:-2], .[-2:], .[3:3][1:], .[10:]]
[0,1,2,3,4,5,6]
-[[], [2,3], [0,1,2,3,4], [5,6]]
+[[], [2,3], [0,1,2,3,4], [5,6], [], []]
del(.[2:4],.[0],.[-2:])
[0,1,2,3,4,5,6,7]