The R Project SVN R

Rev

Rev 58790 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 58790 Rev 58813
Line 1... Line 1...
1
library(compiler)
1
library(compiler)
2
 
2
 
3
ev <- function(expr)
3
ev <- function(expr)
4
    tryCatch(withVisible(eval(expr)), error = function(e) conditionMessage(e))
4
    tryCatch(withVisible(eval(expr, parent.frame(), baseenv())),
5
 
-
 
-
 
5
             error = function(e) conditionMessage(e))
6
 
6
 
7
f <- function(x) switch(x, x = 1, y = , z = 3, , w =, 6, v = )
7
f <- function(x) switch(x, x = 1, y = , z = 3, , w =, 6, v = )
8
fc <- cmpfun(f)
8
fc <- cmpfun(f)
9
 
9
 
10
stopifnot(identical(ev(quote(fc("x"))), ev(quote(f("x")))))
10
stopifnot(identical(ev(quote(fc("x"))), ev(quote(f("x")))))