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