Re: [Rd] Environment with no parent?

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Wed 09 Feb 2005 - 10:29:37 EST

Duncan Murdoch <murdoch@stats.uwo.ca> writes:

> >(a) efficiency. Is it expensive no longer to have the base functions
> >bound directly to their symbol? (My gut feeling is that with suitable
> >hashing and cacheing, the penalty is minimal.)
> >
> >(b) you can *only* use get and simple variable retrieval in a non-base
> >environment with a NULL parent (eval(x <- 1, envir=foo) would give
> >'couldn't find function "<-"' or so). This could cause some confusion.
>
> (b) means that the default should stay the way it is, but I think
> there should be a way to set up a truly empty environment. We have a
> fair number of cases where envir=NULL is used, so it would be safest
> to make it a different value -- even if NULL is the obvious value for
> an empty environment.

Not necessarily. It just means that you should think about it. It is not a given that envir=NULL really means what the author expected, and fixing them up to read envir=.BaseEnv is probably quite doable.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907

______________________________________________
R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Wed Feb 09 09:39:31 2005

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 09:02:47 EST