ListValues[A: A, N: ListNode[A] #read]

Iterate over the values in a list.

class ref ListValues[A: A, N: ListNode[A] #read] is
  Iterator[N->A] ref

Implements


Constructors

create

Keep the next list node to be examined.

new ref create(
  head: (N | None val),
  reverse: Bool val = seq)
: ListValues[A, N] ref^

Parameters

  • head: (N | None val)
  • reverse: Bool val = seq

Returns


Public Functions

has_next

If we have a list node, we have more values.

fun box has_next()
: Bool val

Returns


next

Get the value of the list node and replace it with the next one.

fun ref next()
: N->A ?

Returns

  • N->A ?