class base range
implements range
private nonnegative the begin
private nonnegative the end
Specifies whether the collection has zero elements.
implement boolean is empty => the begin == the end
Specifies whether the collection has more than zero elements.
Shortcut for !is_empty.
implement boolean is not empty => the begin != the end
Access the first element of the list.
Assumes the list is not empty.
implement nonnegative first()
assert is not empty
return the begin
Read the list's element for the specified index.
implement implicit readonly reference[nonnegative] get(nonnegative index) pure
Enumerates elements in some collection-defined order.
This method returns a snapshot of the collection state, so subsequent mutations
of the collection do not cause changes in the returned list.
implement range elements()
return this
Returns an immutable list with the order of the elements reversed.
implement immutable list[nonnegative] reverse()
for var value : the end - 1; value >= the begin; value -= 1
nonnegative value : value
assert nonnegative value is nonnegative
return result • frozen copy()
Check whether the list has at least one element that satisfies the predicate.
implement boolean has(predicate[nonnegative] the predicate) pure