Re: [Rd] issue with promises for time parameter of rep()

2017-09-19 Thread luke-tierney
Thanks. Fixed in R-devel and R-patched. This now gives f <- function(n) { print(ls.str()) rep("hello", times = n) } f(n) ## n : ## Error in f(n) : object 'n' not found ## In addition: Warning message: ## In f(n) : restarting interrupted promise evaluation Best, luke On Mon, 18 Sep 201

Re: [Rd] issue with promises for time parameter of rep()

2017-09-19 Thread Lionel Henry
Here is the same issue with closures: g <- function(n) { missing(n) } f <- function(n, force) { if (force) { tryCatch(n, error = function(...) NULL) } g(n) } g(`_x`) #> [1] FALSE f(`_x`, force = FALSE) #> [1] FALSE f(`_x`, forc