-
Notifications
You must be signed in to change notification settings - Fork 2
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
Functions with %*% cannot be differentiated.... #16
Comments
Currently an operator |
You also need to define it for regular R objects?
|
Oh, my fault. |
And the behavior of R matrix multiplication also doesn't match the behavior of Julia matrix multiplication. |
A vector is mathematically equivalent to a n by 1 matrix. Julia handles this quite well, but it is not the case in R. It is more a question for JuliaCall and RCall. |
I have considered this kind of approach for The problem is that if users use this method in the REPL after And I also think once it is broken, users will be very confused because all they see is |
There are tricky ways to deal with the problem. The best way I can think of is that for every function that is passed to |
I assume the package would depend on |
If the package depends on And it is also a general issue with other internal generics and non-generics. Should we redefine them? Or should we introduce other new functions to use instead? |
This is an important enough issue that I think it worthwhile to start a vignette to show what goes wrong, using examples. I suggest creating numbered functions for different tries, e.g., JuliaObject1, JuliaObject2, ... with JuliaObject itself reserved for the latest (and hopefully best) solution. Having such a vignette (possibly like a "history" of attempts, with explanations -- need not be terribly tidy) will allow us to ask others for help. Possibly Duncan Murdoch can give some insight. |
This is because of the operator
%*%
in R is only S4 generic but not S3 generic, so%*%
onJuliaObject
can't be overloaded currently....From the R documentation of
matmult
,%*%
Currently I can think of two ways to deal with the problem, one way is to make JuliaObject an S4 again, and it will occur some additional overloading.
The other one is to define some new operator like
%x%
to be used instead of%*%
.The text was updated successfully, but these errors were encountered: