[Rd] R6 "classname" and generator name
Barry Rowlingson
b@row||ng@on @end|ng |rom |@nc@@ter@@c@uk
Mon Mar 11 13:15:20 CET 2024
I'm writing some code that does a bit of introspection of R6 classes and am
wondering about the "classname" parameter. Its the first parameter to the
"R6Class" class generator generator function, and the few examples I've
looked at on CRAN set it the same as the name of the generator function,
for example, from the docs:
Queue <- R6Class("Queue", .....)
but this isn't mandatory, it can be anything. Or NULL. (side quest: do
linters exist that flag this as bad style?).
Does anyone have an example of a CRAN package where this isn't the case? Or
even where an R6 class generator uses the default "NULL" for its classname
parameter? My introspection code is in two minds whether to use the
classname to label diagrams of classes, or to use the names of the actual
generator functions (which are what the package users should be using), or
show both if different, or flag up NULL values etc...
Never should have opened this can of worms. I don't even like worms.
Barry
[[alternative HTML version deleted]]
More information about the R-devel
mailing list