[Rd] Finding the environment of a promise

Hadley Wickham hadley at rice.edu
Wed Sep 9 15:30:57 CEST 2009


Hi all,

Is it possible to determine the environment in which a promise will be
evaluated?  e.g.

f <- function(code) { force(code) }
f({
  a <- 1
  b <- 2
})

Is there any way to tell from within f that a and b will be created in
the global environment?

Thanks,

Hadley

-- 
http://had.co.nz/



More information about the R-devel mailing list