How to access a return value of a function that is being traced
问题 Is there any way of accessing return value of a function that is being traced by a function specified as exit param to trace? That sounds hard to understand, but I was not able to simplify the question without loosing the information. So here is a simple example. We have a simple function add10 <- function(a){ a + 10 } And some function that we want to be called when call to add10 exits. trace.exit() <- function(){ ... } Tracing is set up the following way. trace(add10, exit=trace.exit) And