Skip to content
Prev 351089 / 398502 Next

Feature or bug?

If you add a print statement to trace the evaluation of the input argument
you can see how the lazy evaluation works:
cat("# update() is changing global ginput's time from", ginput$time,
"to", newtime, "\n")
    ginput <<- list(time = newtime)
    }
if (doFirstPrint) {
        cat("# Before calling update(1): input$time=", input$time,
"ginput$time=", ginput$time, "\n")
    }
    update(1)
    cat("# After calling update(1): input$time=", input$time,
"ginput$time=", ginput$time, "\n")
    }
doFirstPrint=TRUE)
# Evaluating server's 'input' argument
# Before calling update(1): input$time= 0 ginput$time= 0
# update() is changing global ginput's time from 0 to 1
# After calling update(1): input$time= 0 ginput$time= 1
doFirstPrint=FALSE)
# update() is changing global ginput's time from 0 to 1
# Evaluating server's 'input' argument
# After calling update(1): input$time= 1 ginput$time= 1


Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Thu, May 21, 2015 at 7:48 AM, peter dalgaard <pdalgd at gmail.com> wrote: