range

fun range(start: Int, end: Int): Slice<T, V>(source)

Selects a range of indices from start (inclusive) to end (exclusive).

This is equivalent to Python's slice notation start:end. Supports negative indexing where -1 represents the last element.

Return

a Range slice descriptor

Parameters

start

the starting index (inclusive), can be negative

end

the ending index (exclusive), can be negative

Throws

if start >= end after normalization