Skip to content
Back to formatted view

Raw Message

Message-ID: <24028.56219.587473.868323@stat.math.ethz.ch>
Date: 2019-11-26T08:00:27Z
From: Martin Maechler
Subject: BUG?: A copy of base::`+` (primitive) is not a clone but a "pointer"
In-Reply-To: <e5560820-c958-877f-a5b5-0cd41d2e527c@gmail.com>

>>>>> 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

>