next


next(iter, @optional arg = void)
      

Move the iterator iter forward by one position. The value of arg is passed to the call to yield that created the iterator and will become its return value.

Return the updated iterator.

Examples:


let a = false
function f(x)
  letfn loop ()
  { let b = yield x
    a = b
    x = x + 1
    loop() }

let iter = f(10)
first(iter)
;; 10
first(next(iter, 'hi))
;; 11
a
;; hi
      

Also see:

rest


Core Module Index | Contents