Hmmmm, I thought of an approach -- a kind of manual dispatch technique. My 
generic is

recover_data <- function(object, ...) {
    rd <- try(getS3method("recover_data", class(object)[1], envir = .GlobalEnv, 
silent = TRUE))
    if (!inherits(rd, "try-error"))
        rd(object, ...)
    else
        UseMethod("recover_data")
}

and similar for emm_basis. The idea is it tries to find the method among 
globally registered ones, and if so, it uses it; otherwise, the internal one is 
used.

Comments? This does seem to add some overhead, but maybe not too unreasonably 
much.

Russ

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to