Skip to content
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

fix %in% and negative 'nanoperiod' parse. closes #96 #99 #100

Merged
merged 2 commits into from
Mar 6, 2022

Conversation

lsilvest
Copy link
Collaborator

@lsilvest lsilvest commented Mar 6, 2022

Changing the type on which nanotime is based from integer64 to numeric does not solve the dispatch problems. It looks like there is a more fundamental dispatch issue in R when S3 methods are defined outside of base.

Here I have solved the issue by providing both S3 and S4 methods for %in%. When bit64 is not explicitly loaded and no S3 method exists, the S4 method is invoked. After bit64 is loaded the S3 method is invoked because if it is not present the bit64 S3 method will trump the nanotime S4 method.

Also fixed the parsing of a nanoperiod when it consists of only its negative nanoduration part.

@eddelbuettel
Copy link
Owner

Changing the type on which nanotime is based from integer64 to numeric does not solve the dispatch problems

Ack. There is clearly some voodoo there. I also see some packages do S3 registration tricks at load time by I am not all that fluent wuth that trick either.

But getting rid of the 'noise' at load time is ❤️

Copy link
Owner

@eddelbuettel eddelbuettel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Wild how the entire change is (essentially) the method declaration (and reactivation of the parked code).

@eddelbuettel
Copy link
Owner

I fixed a micro-typo/mis-edit in NEWS.Rd and am updating the docs. I think we can ship this to CRAN as is otherwise.

@eddelbuettel eddelbuettel deleted the fix_in_operator branch October 5, 2022 00:40
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

Successfully merging this pull request may close these issues.

None yet

2 participants