r-lib / R6

Encapsulated object-oriented programming for R
https://R6.r-lib.org
Other
412 stars 57 forks source link

Get generator from instance #286

Closed dipterix closed 4 months ago

dipterix commented 5 months ago

I wonder if it's possible to get generator class from its instance (like R6::getR6Class(r6) -> generator? Right now we can only get the class name.

wch commented 5 months ago

You're correct that you can only get the class name from the instance; there isn't a way to get the generator from an instance.

dipterix commented 5 months ago

Got it. Totally understand the potential issues.

Do you know if any class definitions can do this, S3 S4 R6 S7?