search for: add_on_exit

Displaying 1 result from an estimated 1 matches for "add_on_exit".

2013 Nov 03
1
on.exit() & sys.on.exit(): Calling them via eval() does not work as hoped
Why does the following eval() call on sys.on.exit() not return what I expect/evaluate in the proper environment? foo <- function() { cat("foo()...\n"); on.exit( message("exiting") ) cat("sys.on.exit():\n") res <- sys.on.exit() print(res) cat("eval(sys.on.exit()):\n") expr <- quote(sys.on.exit()) print(expr) res <- eval(expr)