From Martin Maechler <maechler@stat.math.ethz.ch>  Fri Jun 28 10:58:10 2002
From: Martin Maechler <maechler@stat.math.ethz.ch> (Martin Maechler)
Date: Fri, 28 Jun 2002 11:58:10 +0200
Subject: (PR#1715) Re: package `methods' has persistent effects even if
 detached
In-Reply-To: <15644.10672.168515.693504@mithrandir.hornik.net>
References: <200206280551.HAA06028@pubhealth.ku.dk>
 <Pine.GSO.4.44.0206280919500.23166-100000@auk.stats>
 <15644.10672.168515.693504@mithrandir.hornik.net>
Message-ID: <15644.13106.766528.617696@gargle.gargle.HOWL>

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


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