Bundle Generic collections library: Vector (dynamic array), Map (hash map), Set, MultiMap, Stack, Queue, and Pair. Provides typed iteration, sorting, filtering, and functional operations (Reduce, Any, All). Compile with -lib gen_collect.
BackwardIterator
Backward iterator
Operations
Get #
Gets the value that's currently pointed to
method : public : Get() ~ HReturn
| Type | Description |
|---|---|
| H | value value |
Example
list := Collection.List->New()<String>;
list->AddBack("last");
it := list->BackwardIterator()<String>;
it->Get()->PrintLine(); # lastMore #
Checks to see the pointer can be advanced Backward
method : public : More() ~ BoolReturn
| Type | Description |
|---|---|
| Bool | true if pointer can be advanced, false otherwise |
Example
list := Collection.List->New()<String>;
list->AddBack("x");
it := list->BackwardIterator()<String>;
it->More()->PrintLine(); # trueNext #
Advances the pointer Backward
method : public : Next() ~ NilExample
list := Collection.List->New()<String>;
list->AddBack("a");
list->AddBack("b");
it := list->BackwardIterator()<String>;
while(it->More()) {
it->Get()->PrintLine();
it->Next();
};Remove #
Removes the element at the pointer position
method : public : Remove() ~ NilExample
list := Collection.List->New()<String>;
list->AddBack("a");
list->AddBack("b");
it := list->BackwardIterator()<String>;
it->Remove();
list->Size()->PrintLine(); # 1