r-lib / R6

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

Get generator from instance #286

Open dipterix opened 2 days ago

dipterix commented 2 days 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 2 days 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 2 days ago

Got it. Totally understand the potential issues.

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