ListNodes[A: A, N: ListNode[A] #read]
Iterate over the nodes in a list.
class ref ListNodes[A: A, N: ListNode[A] #read] is Iterator[N] ref
Implements
- Iterator[N] ref
Constructors
create
Keep the next list node to be examined.
new ref create( head: (N | None val), reverse: Bool val = false) : ListNodes[A, N] ref^
Parameters
Returns
- ListNodes[A, N] ref^
Public Functions
has_next
If we have a list node, we have more values.
fun box has_next() : Bool val
Returns
- Bool val
next
Get the list node and replace it with the next one.
fun ref next() : N ?
Returns
- N ?
© 2016-2020, The Pony Developers
© 2014-2015, Causality Ltd.
Licensed under the BSD 2-Clause License.
https://stdlib.ponylang.io/collections-ListNodes