# NOT RUN {
f <- function(x) 2 + x
cb <- rewrite_callbacks() %>%
add_call_callback(f, function(expr, ...) {
quote(2 + x)
})
tr_f <- . %>% rewrite() %>% rewrite_with(cb)
g <- function(y) y + f(y)
tr_f(g)
# }
Run the code above in your browser using DataLab