Skip to content

Mixing S4 and S7 inheritance hierarchies #456

@lawremi

Description

@lawremi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions