Skip to content
Prev 62952 / 63421 Next

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

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:
Message-ID: <CAFDcVCRUakN0pdCZNLjdQkw135EqCEjURUqLSCov7KALjFUO9g@mail.gmail.com>
In-Reply-To: <CAFDcVCR14Tqoz4eKR5pFZLSTpoDxv2jE9fs3B0w4ZO6=CdmrXw@mail.gmail.com>