Displaying 1 result from an estimated 1 matches for "exprobj".
2009 Jun 12
0
.doTrace problem with eval.parent(substitute(expr)) vs. lazy evaluation of expr
...)}))
Tracing function "system" in package "base"
[1] "system"
> system("sleep 4")
Tracing system("sleep 4") on entry
sleep 4 took 0 0 0 0 0
[4 second pause before the next prompt]
If I change .doTrace by changing its
exprObj <- substitute(expr)
eval.parent(exprObj)
to just
expr # evaluate in caller's environment by lazy evaluation
then the on.exit works as I wished it to. I think the on.exit clause
is being executed at the end of eval.parent() instead of at the end of
the caller of .doTrace (put...