Skip to content

Feature request: Add function for getting any object's S7 class representation #559

@dgkf

Description

@dgkf

Filing as a separate issue following discussion in #558

Retrieving an S7 class in a way that can be used for dispatch currently requires handling non-S7 classes as special cases. It would be great if the internal mechanisms of deriving S7-dispatchable classes from non-S7 objects was exposed.

Specifically, this would support cases where method() is being used for non-standard dispatch.

Is S7::S7_class the right place for this? Currently it only supports S7 class objects:

library(S7)
Foo <- new_class("Foo")
S7_class(Foo())
#> <Foo> class
#> @ parent     : <S7_object>
#> @ constructor: function() {...}
#> @ validator  : <NULL>
#> @ properties :

S7_class(1)
#> NULL

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