

   EEvvaalluuaattee aann ((UUnneevvaalluuaatteedd)) EExxpprreessssiioonn

        eval(expr, envir=sys.frame(sys.parent()))

   AArrgguummeennttss::

       expr: object of mode `expression' or an ``unevaluated
             expression''.

      envir: the `environment' in which `expr' is to be evalu-
             ated.

   DDeessccrriippttiioonn::

        This function evaluates the expression `expr' argument
        in the environment specified by `envir' and returns the
        computed value.  If `envir' is not specified, then
        `sys.frame(sys.parent())', the environment where the
        call to `eval' was made is used.  This allows you to
        assign complicated expressions to symbols and then
        evaluate them. If you want to evaluate `expr' in
        `envir' then you must wrap a call to `expression'
        around it.

   SSeeee AAllssoo::

        `expression', `sys.frame', `environment'.

   EExxaammpplleess::

        eval(2 ^ 2 ^ 3)
        mEx <- expression(2^2^3); mEx; 1 + eval(mEx)
        eval({ xx <- pi; xx^2}) ; xx

        ev <- function() {
             e1 <- sys.frame(sys.parent())
             ## Evaluate a in e1
             aa <- eval(expression(a),e1)
             ## evaluate the expression bound to a in e1
             a <- expression(x+y)
             list(aa = aa, eval = eval(a, e1))
        }
        tst.ev <- function(a = 7) { x <- pi; y <- 1; ev() }
        tst.ev()#-> aa : 7,  eval : 4.14

