inst/examples/ihasNextExample.R

library(iterors)

n <- 100
it <- ihasNext(icount(n))

total <- 0
while (hasNext(it))
  total <- total + nextOr(it)

print(total == sum(seq(length=n)))

Try the iterors package in your browser

Any scripts or data that you put into this service are public.

iterors documentation built on May 31, 2023, 5:36 p.m.