From b@row||ng@on @end|ng |rom |@nc@@ter@@c@uk  Mon Mar 11 13:15:20 2024
From: b@row||ng@on @end|ng |rom |@nc@@ter@@c@uk (Barry Rowlingson)
Date: Mon, 11 Mar 2024 12:15:20 +0000
Subject: [Rd] R6 "classname" and generator name
Message-ID: <CANVKczP7UBx4b9=qXeBHXbf4S4p_MG+S50VPJ7_ze8Rj3U20DQ@mail.gmail.com>

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]]



[Rd] R6 "classname" and generator name
Barry Rowlingson