x <- 0
persistEvalQ({if((x<-x+1)<3) stop("x < 3") else x},
beforeRetry = {cat("Will try incrementing...\n")})
x <- 0
e <- quote(if((x<-x+1)<3) stop("x < 3") else x)
persistEval(e,
beforeRetry = quote(cat("Will try incrementing...\n")))
Run the code above in your browser using DataLab