Re: [Rd] Detecting user interrupts in R_tryEval

2016-07-07 Thread William Dunlap via R-devel
In R code tryCatch can detect the difference. Hit control-C (on Unixen) or Escape (on Windows) to interrupt the long-running for loop and see that the interrupt clause gets called: > z <- tryCatch(for(i in seq_len(1e8))log(exp(i/10)), error=function(e)e, interrupt=function(e)e) ^C> dput(z)

[Rd] Detecting user interrupts in R_tryEval

2016-07-07 Thread Jeroen Ooms
Is there any way to distinguish between an error and a user interruption in R_tryEval? In both cases the ErrorOccurred argument is set to 1. For my application I need a different action in case of a SIGINT. >From the source code I infer that R_tryEval basically wraps eval in R_ToplevelExec, which