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 19, 2017, 6:11 a.m.