# Manually iterate using the iteration_has_ended function to help
it <- iter(1:3)
tryCatch({
stopifnot(is.iterator(it))
repeat {
print(nextElem(it))
}
},
error=function(e) {
if (!iteration_has_ended(e)) {
stop(e)
}
})
Run the code above in your browser using DataLab