Skip to content

structure(<primitive function>, ...) is sticky: a bug, or should it be an error?

1 message · Henrik Bengtsson

#
Thank you Martin - I've been following your commits to R-devel and
R-beta. FWIW, I've just verified that it works as expected - I scanned
the base environment for all primitive functions and then verified
that attr(x, "abc") <- TRUE gives an error on R-devel;

$ R --vanilla
R Under development (unstable) (2025-04-02 r88098) -- "Unsuffered Consequences"
Error in attr(sum, "abc") <- TRUE : cannot set attribute on a 'builtin'

a warning on R-beta;

$ R --vanilla
Warning message:
In attr(sum, "abc") <- TRUE :
  Setting attributes on primitive functions is deprecated and will be disabled

and neither on R release.

For the warning in R 4.5.0 beta, have you considered making it a
warning of class 'deprecatedWarning'? Not a big deal, but wanted to
mention it, just in case.

/Henrik

On Fri, Mar 21, 2025 at 10:07?AM Henrik Bengtsson
<henrik.bengtsson at gmail.com> wrote: