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

Review object_class() / r7_class_name() #163

Closed
hadley opened this issue Feb 12, 2022 · 2 comments · Fixed by #183
Closed

Review object_class() / r7_class_name() #163

hadley opened this issue Feb 12, 2022 · 2 comments · Fixed by #183

Comments

@hadley
Copy link
Member

hadley commented Feb 12, 2022

These are a pair of functions responsible for generating the character vectors used to index into the method table, for method registration (single class) and method dispatch (all classes). I think they need to:

  • Add a prefix for OO type (to disambiguate between S3, S4, and R7 classes with the same name)
  • Include the package name for S4 classes, where available
@hadley
Copy link
Member Author

hadley commented Feb 14, 2022

Probably rename to:

  • object_class()+ part of method_rec() -> class_dispatch()
  • r7_class_name() -> class_register()

This was referenced Feb 14, 2022
@hadley
Copy link
Member Author

hadley commented Feb 16, 2022

Will need to make sure that base types in S3 classes don't get prefix, and that S4 subclasses of S3 classes get the right parents.

hadley added a commit that referenced this issue Feb 22, 2022
THe minimal set of changes to disambiguate between:

* S4 vs R7/S3/base cases: `S4/foo` vs `foo`
* S4 classes with same name in different packages: `S4/pkgA::foo` vs `S4/pkgB::foo`
* R7 classes with same name in difference packages: `pkgA::foo` vs `pkgB::foo`

I used `::` as the separator because running `pkg::class` will typically get you the class.

Fixes #48. Fixes #163
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 a pull request may close this issue.

1 participant