Re: [Rd] Ignore user interrupts

2012-01-27 Thread Charlie Sharpsteen
On Fri, Jan 27, 2012 at 6:25 AM, wrote: > On Thu, 26 Jan 2012, Sharpie wrote: >> The only odd thing I came across was when I tried to test this function >> using `Sys.sleep` instead of a long loop: >> >>   evalWithoutInterrupts(Sys.sleep(3);message("Hello, world!")}) >> >> The call can be interru

Re: [Rd] Ignore user interrupts

2012-01-27 Thread luke-tierney
On Thu, 26 Jan 2012, Sharpie wrote: Sharpie wrote evalWithoutInterrupts <- function(expr, envir = parent.frame()) { .Call(do_evalWithoutInterrupts, expr, envir) } With a C-level implemention: SEXPR do_evalWithoutInterrupts(SEXP expr, SEXP envir) { SEXP result; BEGIN_SUSPEND_INTERRUP

Re: [Rd] Ignore user interrupts

2012-01-26 Thread Sharpie
Sharpie wrote > > evalWithoutInterrupts <- function(expr, envir = parent.frame()) > { > .Call(do_evalWithoutInterrupts, expr, envir) > } > > > With a C-level implemention: > > SEXPR do_evalWithoutInterrupts(SEXP expr, SEXP envir) > { > SEXP result; > > BEGIN_SUSPEND_INTERRUPTS{ > re

Re: [Rd] Ignore user interrupts

2012-01-23 Thread Sharpie
Sharpie wrote > > If not, would it work to move the function call into a C function that > uses `eval` inside a block protected by BEGIN_SUSPEND_INTERRUPTS? > Just to clarify, if there is no functionality at the R level for evaluating an expression without interrupts, would it be possible to cr

[Rd] Ignore user interrupts

2012-01-23 Thread Sharpie
Is there a way to suspend user interrupts for the duration of a function call? There is a point in one of my packages where values are being written to a Filehash database. If the user is unlucky enough to send an interrupt while this code is active, then they have to: - Hunt down a lock file an