Skip to content

Direct call to S3 method from bit64 #137

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

Open
MichaelChirico opened this issue Jan 31, 2025 · 2 comments
Open

Direct call to S3 method from bit64 #137

MichaelChirico opened this issue Jan 31, 2025 · 2 comments

Comments

@MichaelChirico
Copy link
Contributor

Here are some direct calls to an S3 method

as.nanoduration(c.integer64(...))

nanotime(c.integer64(...))

This will stop working in the future when this symbol is un-exported. Is there a reason not to let S3 dispatch "just work" in this case?

See r-lib/bit64#76

@eddelbuettel
Copy link
Owner

Then things break as revealed by a two-minute investigation. Context matters. You should have shown the complete (symmetric) functions:

 c.nanoduration <- function(...) {
     as.nanoduration(c.integer64(...))
 }

I tried both c(as.integer64(...)) and c(...); neither approach made it far under R CMD check. All this is tricky business as we have to mix S4 and S3 semantics. We like the status quo, it worked for eight+ years.

@MichaelChirico
Copy link
Contributor Author

Thanks Dirk. Rest assured I have no interest in breaking working code :)

The timeline here is long -- I won't even touch this in the next release, and will only look at adding warnings in the subsequent release before finally removing the export after that. I will of course retain c.integer64 exported as long as we don't have a fix for you.

I've filed r-lib/bit64#150 to track this specific issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants