R/NAMESPACE.R

Defines functions retList

#' @importFrom utils data download.file install.packages installed.packages
#'   packageVersion str
NULL

retList <- function(class = NULL, public = ls(envir), super = list(), envir = parent.frame()) {
  ## This is a variation of aoos::retList. Without the former inheritance
  ## mechanism. Maybe this with a different name is sufficient to supply
  ## OO-features in this package.
  public <- unique(c(public, names(super)))
  classes <- c(class, class(super))
  envir$.self <- envir
  out <- super
  out[public] <- as.list(envir, all.names = TRUE)[public]
  class(out) <- classes
  out
}
wahani/module documentation built on Jan. 28, 2024, 9:03 a.m.