[Rd] BUG?: A copy of base::`+` (primitive) is not a clone but a "pointer"

Martin Maechler m@ech|er @end|ng |rom @t@t@m@th@ethz@ch
Tue Nov 26 09:00:27 CET 2019


>>>>> Benjamin Tyner 
>>>>>     on Mon, 25 Nov 2019 22:34:33 -0500 writes:

    > For what it's worth, the current behavior seems to have begun starting 
    > with version 3.6.0. If I run in version 3.5.3:

    >> p1 <- .Primitive('+') ; p2 <- p1 ; attr(p1, "myattr") <- 1 ; p2

    > function (e1, e2)  .Primitive("+")

No.  What changed was just the *printing* !
(still in R 3.5.x) :

> p1 <- .Primitive('+') ; p2 <- p1 ; attr(p1, "myattr") <- pi ; attributes(p2)
$myattr
[1] 3.141593

>



More information about the R-devel mailing list