Range is a pointer to a pointer to several consecutive elements. A range can be used to enumerate elements directly or using iterators or to construct another container from it.

Methods

at ( index -- value )  returns an entry by its relative index

bound ( lowerKey upperKey -- range )  returns a range pointing to all elements having keys within a given interval

empty ( -- condition )  checks if the range is empty

endIter ( -- iterator )  returns an end iterator for the range

first ( -- value )  returns the first element of the range

first ( -- { key: Key; value: Value; } )  returns the first element of the range

firstIter ( -- iterator )  returns an iterator pointing to the first element of the range

getSize ( -- size )  returns the number of entries in the range

last ( -- value )  returns the last element of the range

last ( -- { key: Key; value: Value; } )  returns the last element of the range

lastIter ( -- iterator )  returns an iterator pointing to the last element of the range

lbound ( key -- range )  returns a range pointing to all elements that are not less than a given key

makeRange ( -- range )  creates a range that points to all entries of this range

rbound ( key -- range )  returns a range pointing to all elements that are less than a given key

set ( value index -- )  sets an entry by its relative index

single ( -- condition )  checks if the range contains only one element

sort ( -- range )  sorts elements in the range

subRange ( firstIndex afterLastIndex -- range )  returns a subrange by relative indexes of its start and end

unhead ( -- value range )  returns the first element of the range and the remaining range

unhead ( -- { key: Key; value: Value; } range)  returns the first element of the range and the remaining range

unheadIter ( -- iterator range )  returns the first iterator and the remaining range

untail ( -- range value )  returns the range without its last element, and that last element

untail ( -- range { key: Key; value: Value; } )  returns the range without its last element, and that last element

untailIter ( -- range iterator )  returns the range without its last element, and its last iterator

Free functions

enum ( range body -- )  enumerates all entries in a range

enumIter ( range body -- )  enumerates all iterators in a range

Tags

CONTAINER,RANGE, ARRAY_RANGE, LIST_RANGE, HASH_TABLE_RANGE, RED_BLACK_TREE_RANGE