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

Mixing S4 and S7 inheritance hierarchies #456

Open
lawremi opened this issue Oct 8, 2024 · 1 comment
Open

Mixing S4 and S7 inheritance hierarchies #456

lawremi opened this issue Oct 8, 2024 · 1 comment

Comments

@lawremi
Copy link
Collaborator

lawremi commented Oct 8, 2024

It may be possible to have an S4 object inherit from S7_object. Some things that would need to happen:

  • To enable an S4 class inheriting from an S7 class, S4_register() would need to pass a transient class to S4Class= on setOldClass() to establish the inherited slots on the S4 class.
  • To enable S7 extending S4, we would need to remove the stop() and figure out things like how to construct the parent S4 instance, allow access to the S4 properties in prop_set_() and probably other things.
  • To enable either direction, and support getters/setters on the S7 properties, @() would need to prioritize dispatch (instead of guarding against S4 objects). This would have a performance impact on S4 code that uses a lot of @(). We may have to sacrifice that feature for now.
@hadley
Copy link
Member

hadley commented Oct 16, 2024

The first bullet is possibly related to #214

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

No branches or pull requests

2 participants