Immutable empty collection.
class empty[value element type]
public empty()
The number of elements in the collection.
implement nonnegative size
Specifies whether the collection has zero elements.
implement boolean is empty
Specifies whether the collection has more than zero elements. Shortcut for !is_empty.
implement boolean is not empty
Access the first element of the list. Assumes the list is not empty.
implement element type first()
Access the last element of the list. Assumes the list is not empty.
implement element type last()
Read the list's element for the specified index.
implement implicit readonly reference[element type] 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 immutable list[element type] elements()
Returns an immutable copy of this list.
implement immutable empty[element type] frozen copy()
Skips over the specified count of elements and returns an immutable slice that begins with count and ends with the end of this list.
implement immutable list[element type] skip(nonnegative count)
Returns an immutable sublist with the given the starting and ending indices.
The starting index is inclusive, the ending is exclusive.
implement immutable list[element type] slice(nonnegative begin, nonnegative end)
Returns an immutable list with the order of the elements reversed.
implement immutable list[element type] reverse()
Check whether the list has at least one element that satisfies the predicate.
implement boolean has(predicate[element type] the predicate) pure