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¶
¶ Suffix
Type
Description
for iterating over the elements
for iterating over the elements in the reverse order
number of elements in the enumerable
check if enumerable contains an item
check if enumerable is empty
verbose dump of all contained elements
- Enumerable:ITERATOR¶
- Type
- Access
Get only
An alternate means of iterating over an enumerable. See:
Iterator
.
- Enumerable:REVERSEITERATOR¶
- Type
- 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