Convert negative indices to positive ones. Use the convention that
vec[[-1L]]
signifies the last element of vec
, vec[[-2L]]
signifies the second-to-last element of vec
, and so on. 1-based
indexing is assumed. Values of zero, or out-of-range indices, will be
rejected.
.get_actual_index(index, length)
Integer; the index to normalize.
Integer; the length of the vector or list we are indexing.
The "actual" integer index, between 1 and length
, inclusive.