Skip to content
Prev 36725 / 63424 Next

Restrict access to variables in parent environment

On Fri, May 14, 2010 at 10:13 AM, Simon Urbanek
<simon.urbanek at r-project.org> wrote:
I didn't think of the corner cases. I'm OK with stats::rnorm or
stats:::rnorm. But '{' is not recognized. How to make it be
recognized?

b=1
f=function() {
  stats::rnorm(b)
}
f()
#environment(f)=base()
environment(f)=emptyenv()
f()