-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
Description
R/class-workbook.R has become quite massive (6000+ lines!)
This can be reduced by a little {R6} wrapper trick (yes, more wrappers). An example can be seen with the {desc} package: https://github.com/r-lib/desc/blob/main/R/description.R
method inside object:
set_value = function(wb, ...) {
set_value_impl(self, private, ...)
}function outside object:
set_value_impl <- function(self, private, ...) {
# perform some actions
...
self
}Because self and private are environments, they can be modified wherever. This means we'd be able to pull these values into separate functions and save some of the more complex functions in separate files.
Essentially,
wb_function(wb, ...) calls
wb$function(...) calls
wb_function_impl(self, private, ...)