From murdoch at stats.uwo.ca  Fri Nov  4 01:55:42 2005
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Thu, 03 Nov 2005 19:55:42 -0500
Subject: [Rd] Changes to environments in R-devel
Message-ID: <436AB18E.6080305@stats.uwo.ca>

I've just committed some changes to R-devel which affect environments. 
Specifically:

  - using NULL as an environment is now deprecated:  use baseenv() 
instead.  (baseenv() is already available in R 2.2.0, where it returns 
NULL.  For most purposes it retains the same meaning in R-devel.) If you 
do use NULL, it will be converted to baseenv(), and a warning printed. 
For example:

 > f <- function(x) 1
 > environment(f) <- NULL
Warning message:
use of NULL environment is deprecated
 > environment(f)
<environment: base>

There may be some places where I've missed putting the conversion in 
place, and use of NULL will cause an error; please let me know if you 
find any of those.  The intention is that NULL will be usable with 
warnings through to the end of the 2.3.x releases.

  - baseenv() is no longer its own parent.  Its parent is an empty 
environment, available as emptyenv().

  - You can now create your own environment with emptyenv() as its 
parent.  Searches for variables in such an environment will not 
automatically proceed to baseenv(), as searches do in current R releases.

Duncan Murdoch



[Rd] Changes to environments in R-devel
Duncan Murdoch