Skip to content
Prev 20723 / 63424 Next

delayedAssign and interrupts

On 5/19/2006 9:54 AM, Roger D. Peng wrote:
I don't know of one.  Normally substitute(x) is supposed to retrieve the 
  promise expression, but by a strange quirk of history, it does not 
work when x is in .GlobalEnv.

I'd say the behaviour you're seeing is a bug.  If I do

 > x <- 2
 > x <- {Sys.sleep(1); 1}  # Break before complete

 > x
[1] 2

nothing is changed about x.  I would think the same thing should happen 
when x is a promise:  if the evaluation of the promised expression 
fails, the promise should not be changed.

Duncan Murdoch