R/eval.R

Defines functions evalq

Documented in evalq

### =========================================================================
### The eval() generic
### -------------------------------------------------------------------------
###
### Need to explicitly define this generic otherwise the implicit generic in
### package "base" would dispatch on all its arguments. Here we set dispatch
### on the first two args (the 'expr' and 'envir' args) only!

setGeneric("eval", signature=c("expr", "envir"),
    function(expr, envir=parent.frame(),
                   enclos=if (is.list(envir) || is.pairlist(envir))
                          parent.frame() else baseenv())
    {
        force(envir)
        force(enclos)
        standardGeneric("eval")
    }
)

evalq <- function(expr, envir = parent.frame(),
                  enclos = if (is.list(envir) || is.pairlist(envir))
                  parent.frame() else baseenv())
  eval(substitute(expr), envir, enclos)

Try the BiocGenerics package in your browser

Any scripts or data that you put into this service are public.

BiocGenerics documentation built on April 17, 2021, 6:01 p.m.