From mark.bravington@csiro.au  Wed May 15 07:30:51 2002
From: mark.bravington@csiro.au (mark.bravington@csiro.au)
Date: Wed, 15 May 2002 08:30:51 +0200 (MET DST)
Subject: [Rd] lib.fixup, .GlobalEnv, and R1.5.0 (PR#1556)
Message-ID: <200205150630.IAA24619@pubhealth.ku.dk>

Full_Name: Mark Bravington
Version: 1.5.0
OS: Windows 2000
Submission from: (NULL) (140.79.2.3)


In R1.3.1, I used the following code inside a function to set a "path" attribute
to .GlobalEnv:

  env_ pos.to.env( 1)
  attr( env, 'path')_ .Path # .Path is a named char vector of length 1
  .Internal( lib.fixup( env, .GlobalEnv)) # adds the attribute

And this works fine. But in R1.5.0, the same code (executed e.g. within a call
to "local" from the command line) removes all the objects in .GlobalEnv (note,
though, that the 'path' attribute does get set OK). For various reasons, this
feature is crucial to me, so I can't actually use R1.5.0 without it!

Oddly, my code used to explicitly set a path attribute for newly-attached things
using this mechanism, and this has now been incorporated into R1.5.0 "library"
command. So I'm clearly not doing anything naughty here!

A suggestion: wouldn't it be easier if we could use

attr( env, <<whatever>>) # where env is an environment

and

attr( env, <<whatever>>)_ 45

instead of having to go via "lib.fixup"?

cheers
Mark


  

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] lib.fixup, .GlobalEnv, and R1.5.0 (PR#1556)
mark.bravington@csiro.au