[Rd] proto and baseenv()

Peter Danenberg pcd at roxygen.org
Sat Feb 27 09:36:20 CET 2010


> One thing that I dislike about scoping in R is the fact that even in a 
> namespace, searches eventually get to the global environment.  I'd prefer 
> if namespace searches went through the imported namespaces and nothing 
> else.  If that were the case, then the a$z example would never find a z in 
> the global environment, and that example would only be a problem for people 
> fiddling around in the console, not programming carefully in a
> package.

Amazing, Duncan; I think you hit upon the perfect compromise. Though
the issues you're bringing up are bigger than proto; at least in the
case of proto, deriving from as.environment(2) is an interesting
stop-gap solution.

Thanks to Gabor for suggesting it.



More information about the R-devel mailing list