R/new.R

Defines functions make_new

#' @export
make_new <- function(class, env = parent.frame()) {
  f <- eval(bquote(function(x, ...) {
    structure(x, ..., class = .(class))
  }))
  environment(f) <- env
  f
}
krlmlr/S3 documentation built on May 20, 2019, 6:16 p.m.