itertools (version 0.1-3)

hasNext: Does This Iterator Have A Next Element

Description

hasNext is a generic function that indicates if the iterator has another element.

Usage

hasNext(obj, ...)
"hasNext"(obj, ...)

Arguments

obj
an iterator object.
...
additional arguments that are ignored.

Value

Logical value indicating whether the iterator has a next element.

Examples

Run this code
  it <- ihasNext(iter(c('a', 'b', 'c')))
  while (hasNext(it))
    print(nextElem(it))

Run the code above in your browser using DataCamp Workspace