Skip to content

dump() bug?

3 messages · Ray Brownrigg, Brian Ripley, Peter Dalgaard

#
Is this a bug?  Certainly it was not expected.  dump() seems to prefer a
global definition over a local one.  R 1.6.1 on Solaris 8 or NetBSD:
character(0)
"D" <-
function (expr, name)
.Internal(D(expr, name))
[1] "D"
"D" <-
function (expr, name)
.Internal(D(expr, name))
The same thing happens with dump(list=ls(), "D.q").

Ray Brownrigg
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
It is not a bug, but it may not be intended.  It is a consequence of
namespaces.  Since dump is in base, it searches base before the user's
workspace.  That is something that seems only to be documented in NEWS.

I don't follow your use of `local' and `global'.  Your `local' copy is in
.GlobalEnv, the global environment aka workspace!
On Wed, 27 Nov 2002, Ray Brownrigg wrote:

            

  
    
#
<ripley at stats.ox.ac.uk> writes:
Sounds like the natural way to fix this would be to add an envir=
argument, defaulting to parent.frame(), and pass it down to the
internal routine?