-
Notifications
You must be signed in to change notification settings - Fork 38
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
What should coercion look like for R7? #136
Comments
How about it behaves like Note that this would be distinct from up casting for affecting dispatch, such as when calling the next method, because casting to affect dispatch should only modify the class, not the structure (so that any extra fields are carried along), and the class modification must be transient so that any dispatch in the next method behaves correctly. |
I think the challenge of avoiding two functions is that you want to write |
(Note to self: remember to also incorporate |
Agreed that the dispatch behavior is weird, but we can implement |
Very initial thoughts: cast <- R7_generic("cast", c("from", "to"), function(from, to, ...) {
signature <- list(to = object_class(to), from = from)
cast <- method(cast, signature)
cast(object, ...)
}) |
No description provided.
The text was updated successfully, but these errors were encountered: