(PR#1715) Re: package `methods' has persistent effects even if detached

Martin Maechler Martin Maechler <maechler@stat.math.ethz.ch>
Fri, 28 Jun 2002 11:58:10 +0200


>>>>> "KH" == Kurt Hornik <hornik@ci.tuwien.ac.at> writes:

>>>>> Prof Brian D Ripley writes:
    >> Sorry, forgot to say this is in R-devel (2002-06-27) but not in 1.5.1.
    >>> class
    >> .Primitive("class")
    >>> find("class")
    >> [1] "package:base"
    >>> library(methods)
    >>> class
    >> .Primitive("dataClass")
    >>> find("class")
    >> [1] "package:methods" "package:base"
    >>> get("class", "package:base")
    >> .Primitive("dataClass")
    >>> detach("package:methods")
    >>> class
    >> .Primitive("dataClass")

    >> so attaching methods is altering the class object *in base*.
    >> Related to namespaces?

    KH> A problem in library(), maybe?

    KH> All I see is

    KH> R/class.R:class <- dataClass

    KH> but surely assignments should be in methods and not in base?

I think JMC mentioned something about the reasons for this, 
and will again (?) when `morning has broken' at the East cost
(and Luke can chime in a bit later ... when the sun touches Midwest.. :-)

My guess is: This is *necessary* now that base is a namespaced,
   since everything in base is using class() as defined in base!
   {use it's own name space first!}.

Martin
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._