Skip to content

internal R6 workbook implementation functions #396

@jmbarbone

Description

@jmbarbone

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, ...)

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions