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
Delayed registration? #5
Comments
Yes, this would be useful. Taking the object-oriented approach, we could have a proxy object representing the generic/class. It would react to the loading of the actual definition. Perhaps constructed like:
Just as with |
I just remembered there's another case where you need condition method registration — when you're releasing a package that works with multiple versions of a dependency. For example, dplyr 1.0.0 added a new generic |
That may be the only practical solution; however, it would obviously be ideal if you could test against a branch of the dependency and then coordinate the release. Anyway, since registration would happen in regular R code, it could operate conditionally, although if we're doing any caching it could get messy. |
That also forces the users of the package to update to the latest version of its dependency; that's not always great if it's mostly a data-analyst facing package. |
I vaguely remember this almost works now already in NAMESPACE, as it allows conditionals; however that of course maybe at the wrong point in time: The (non-)registration should happen at package load time, not at build time. |
Should we explicitly consider delayed registration in the requirements? This is needed if you want to provide a method for a generic (or class) that is available in a suggested (not imported) package.
R-exsts has:
The text was updated successfully, but these errors were encountered: