Enumerable¶
Enumerable
is a parent structure that contains a set of suffixes common to few structures in kOS. As a user of kOS you will never handle pure instances of this structure,
but rather concrete types like List
, Range
, Queue
etc.
Structure¶
-
structure
Enumerable
¶ Members¶ Suffix Type Description ITERATOR
Iterator
for iterating over the elements REVERSEITERATOR
Iterator
for iterating over the elements in the reverse order LENGTH
scalar number of elements in the enumerable CONTAINS(item)
Boolean check if enumerable contains an item EMPTY
Boolean check if enumerable is empty DUMP
string verbose dump of all contained elements
-
Enumerable:
ITERATOR
¶ Type: Iterator
Access: Get only An alternate means of iterating over an enumerable. See:
Iterator
.
-
Enumerable:
REVERSEITERATOR
¶ Type: Iterator
Access: Get only An alternate means of iterating over an enumerable. Order of items is reversed. See:
Iterator
.
-
Enumerable:
CONTAINS
(item)¶ Parameters: - item – element whose presence in the enumerable should be checked
Returns: Returns true if the enumerable contains an item equal to the one passed as an argument