-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-document with latest roxygen2 features #310
Conversation
No need to merge until roxygen2 is on CRAN
Note to self: roxygen2 expected to go to CRAN 2024-01-15 |
S3method(testthat::compare,glue) | ||
S3method(vctrs::vec_cast,character.glue) | ||
S3method(vctrs::vec_cast,glue.character) | ||
S3method(vctrs::vec_cast,glue.glue) | ||
S3method(vctrs::vec_ptype2,character.glue) | ||
S3method(vctrs::vec_ptype2,glue.character) | ||
S3method(vctrs::vec_ptype2,glue.glue) | ||
S3method(waldo::compare_proxy,glue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
glue doesn't (and cannot) depend on testthat, vctrs, waldo, etc. It feels like we're dismantling the conditional and delayed export of these methods and are, instead, assuming that these packages are available.
Am I out of the loop and this is actually OK now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's exactly the point of this form of S3method()
😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upon further research, this is roxygen2 newly taking advantage of a feature that appeared in R 3.6:
https://rstudio.github.io/r-manuals/r-exts/Creating-R-packages.html#registering-s3-methods
As from R 3.6.0 one can also use
S3method()
directives to perform delayed registration. Withif(getRversion() >= "3.6.0") { S3method(pkg::gen, cls) }function
gen.cls
will get registered as an S3 method for classcls
and genericgen
from package pkg only when the namespace of pkg is loaded. This can be employed to deal with situations where the method is not “immediately” needed, and having to pre-load the namespace of pkg (and all its strong dependencies) in order to perform immediate registration is considered too onerous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, really old then 😆
No need to merge until roxygen2 is on CRAN