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

Need to Implement R's internal generics for JuliaObject #53

Open
Non-Contradiction opened this issue May 21, 2018 · 3 comments
Open

Need to Implement R's internal generics for JuliaObject #53

Non-Contradiction opened this issue May 21, 2018 · 3 comments

Comments

@Non-Contradiction
Copy link
Collaborator

According to R's documentation for internal generic

The following primitive and internal functions are generic, i.e., you can write methods for them:

[, [[, $, [<-, [[<-, $<-,

length, length<-, dimnames, dimnames<-, dim, dim<-, names, names<-, levels<-,

c, unlist, cbind, rbind,

as.character, as.complex, as.double, as.integer, as.logical, as.raw, as.vector, is.array, is.matrix, is.na, is.nan, is.numeric, rep, seq.int (which dispatches methods for "seq") and xtfrm

In addition, is.name is a synonym for is.symbol and dispatches methods for the latter. Similarly, as.numeric is a synonym for as.double and dispatches methods for the latter, i.e., S3 methods are for as.double, whereas S4 methods are to be written for as.numeric.

Note that all of the group generic functions are also internal/primitive and allow methods to be written for them.

.S3PrimitiveGenerics is a character vector listing the primitives which are internal generic and not group generic. Currently as.vector, cbind, rbind and unlist are the internal non-primitive functions which are internally generic.

@Non-Contradiction
Copy link
Collaborator Author

Currently only part of the generics are implemented for JuliaObject, and not all of the implementations are sound.

@Non-Contradiction
Copy link
Collaborator Author

The issue is also related to Non-Contradiction/autodiffr#8

@Non-Contradiction
Copy link
Collaborator Author

Just implement rep.JuliaObject, need to add tests later.

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

No branches or pull requests

1 participant