Skip to content
Prev 57727 / 63421 Next

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

$ R --vanilla
R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
...
function (e1, e2)
function (e1, e2)
 - attr(*, "class")= chr "plus"

## Hmm ...
function (e1, e2)
 - attr(*, "class")= chr "plus"
function (e1, e2)

## Hmm ...
function (e1, e2)

Even without assigning to `plus`, you get this behavior:

$ R --vanilla
function (e1, e2)  .Primitive("+")
attr(,"class")
[1] "plus"

# Hmm...
function (e1, e2)
 - attr(*, "class")= chr "plus"

Looks to be the case for common (all?) .Primitive functions.  Is this
expected? Should I report this one to BugZilla?

/Henrik