[Rd] dump() behaves *correctly* with local variables (PR#2400)

ripley@stats.ox.ac.uk ripley@stats.ox.ac.uk
Mon Dec 30 10:45:02 2002


This is as expected; it is your expectations which are incorrect.  Please
read the definition of a bug in the R FAQ.

`x' is defined in the environment of the call to dump, and that is not in
the search path from inside dump().  Please re-check the R scope rules.

It is planned to add an envir argument to dump() from 1.7.x,
which will allow you to do this.  Note the difference from save(),
which does have an envir argument starting at parent.frame().

On Sat, 28 Dec 2002 hannes@ruhrau.de wrote:

> Full_Name: Johannes Hüsing
> Version: 1.6.0.1

No such version!

> OS: Windows 2000
> Submission from: (NULL) (132.252.149.100)
>
>
> The following code produces an error:
>
> > f <- function() { x <- 4; dump("x") }
> > f()
> Error in dump("x") : Object "x" not found
>
> In the documentation the limited functionality
> of the current version of dump() is mentioned.
> It may be a good idea to give this as an example where dump()
> does not (yet) work.

It should never work.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595