Deprecated lifecycle

The eval_ and call_ families of functions provide a replacement for the base R functions prefixed with sys. (which are all about the context stack), as well as for parent.frame() (which is the only base R function for querying the call stack). The context stack includes all R-level evaluation contexts. It is linear in terms of execution history but due to lazy evaluation it is potentially nonlinear in terms of call history. The call stack history, on the other hand, is homogenous.

global_frame()

current_frame()

ctxt_frame(n = 1)

call_frame(n = 1, clean = TRUE)

ctxt_depth()

call_depth()

ctxt_stack(n = NULL, trim = 0)

call_stack(n = NULL, clean = TRUE)

Arguments

n

The number of frames to go back in the stack.

clean

Whether to post-process the call stack to clean non-standard frames. If TRUE, suboptimal call-stack entries by base::eval() will be cleaned up: the duplicate frame created by eval() is eliminated.

trim

The number of layers of intervening frames to trim off the stack. See stack_trim() and examples.

Details

ctxt_frame() and call_frame() return a frame object containing the following fields: expr and env (call expression and evaluation environment), pos and caller_pos (position of current frame in the context stack and position of the caller), and fun (function of the current frame). ctxt_stack() and call_stack() return a list of all context or call frames on the stack. Finally, ctxt_depth() and call_depth() report the current context position or the number of calling frames on the stack.

The base R functions take two sorts of arguments to indicate which frame to query: which and n. The n argument is straightforward: it's the number of frames to go down the stack, with n = 1 referring to the current context. The which argument is more complicated and changes meaning for values lower than 1. For the sake of consistency, the rlang functions all take the same kind of argument n. This argument has a single meaning (the number of frames to go down the stack) and cannot be lower than 1.

Note finally that parent.frame(1) corresponds to call_frame(2)$env, as n = 1 always refers to the current frame. This makes the _frame() and _stack() functions consistent: ctxt_frame(2) is the same as ctxt_stack()[[2]]. Also, ctxt_depth() returns one more frame than base::sys.nframe() because it counts the global frame. That is consistent with the _stack() functions which return the global frame as well. This way, call_stack(call_depth()) is the same as global_frame().

Life cycle

These functions are soft-deprecated and replaced by trace_back().

Examples

# Expressions within arguments count as contexts identity(identity(ctxt_depth())) # returns 2
#> Warning: `ctxt_depth()` is deprecated as of rlang 0.3.0. #> This warning is displayed once per session.
#> [1] 40
# But they are not part of the call stack because arguments are # evaluated within the calling function (or the global environment # if called at top level) identity(identity(call_depth())) # returns 0
#> Warning: `call_depth()` is deprecated as of rlang 0.3.0. #> This warning is displayed once per session.
#> [1] 14
# The context stacks includes all intervening execution frames. The # call stack doesn't: f <- function(x) identity(x) f(f(ctxt_stack()))
#> [[1]] #> <frame 41> (40) #> expr: identity(x) #> env: [local 0x7938108] #> #> [[2]] #> <frame 40> (37) #> expr: f(ctxt_stack()) #> env: [local 0x7937ff0] #> #> [[3]] #> <frame 39> (38) #> expr: identity(x) #> env: [local 0x7937ed8] #> #> [[4]] #> <frame 38> (37) #> expr: f(f(ctxt_stack())) #> env: [local 0x7937d88] #> #> [[5]] #> <frame 37> (36) #> expr: eval(expr, envir, enclos) #> env: [local 0x740b070] #> #> [[6]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x7937bc8] #> #> [[7]] #> <frame 35> (26) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x7937998] #> #> [[8]] #> <frame 34> (26) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x79373e8] #> #> [[9]] #> <frame 33> (32) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x793abf8] #> #> [[10]] #> <frame 32> (31) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x793a5a0] #> #> [[11]] #> <frame 31> (30) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x793a258] #> #> [[12]] #> <frame 30> (29) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x7939b58] #> #> [[13]] #> <frame 29> (28) #> expr: try(f, silent = TRUE) #> env: [local 0x7939880] #> #> [[14]] #> <frame 28> (26) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x79396f8] #> #> [[15]] #> <frame 27> (26) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x7939618] #> #> [[16]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x7b3bd58] #> #> [[17]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x83b1810] #> #> [[18]] #> <frame 24> (23) #> expr: force(code) #> env: [frame 0x83b5df8] #> #> [[19]] #> <frame 23> (22) #> expr: withr::with_options(list(crayon.enabled = getOption("crayon.enabled", <...> #> env: [frame 0x83bc140] #> #> [[20]] #> <frame 22> (21) #> expr: .f(code = .l[[1L]][[1L]], run = .l[[2L]][[1L]], show = .l[[3L]][[1L]], <...> #> env: [frame 0x83baa10] #> #> [[21]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x7d093a8] #> #> [[22]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x805df68] #> #> [[23]] #> <frame 19> (18) #> expr: as_data(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x3e84c48] #> #> [[24]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x881d298] #> #> [[25]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x198d960] #> #> [[26]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x48b2d18] #> #> [[27]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x4bdc4d8] #> #> [[28]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x19009a0] #> #> [[29]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x19cd388] #> #> [[30]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x321df80] #> #> [[31]] #> <frame 11> (0) #> expr: (function (what, args, quote = FALSE, envir = parent.frame()) <...> #> env: [frame 0x321b110] #> #> [[32]] #> <frame 10> (0) #> expr: do.call(do.call, c(readRDS("/tmp/RtmpMVh6Pm/file4d004ee8fc43"), <...> #> env: [frame 0x3218f50] #> #> [[33]] #> <frame 9> (0) #> expr: saveRDS(do.call(do.call, c(readRDS("/tmp/RtmpMVh6Pm/file4d004ee8fc43"), <...> #> env: [frame 0x3219ce0] #> #> [[34]] #> <frame 8> (0) #> expr: withCallingHandlers({ <...> #> env: [frame 0x32188e8] #> #> [[35]] #> <frame 7> (6) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x3215c70] #> #> [[36]] #> <frame 6> (5) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [frame 0x3215fb8] #> #> [[37]] #> <frame 5> (2) #> expr: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) #> env: [frame 0x3216370] #> #> [[38]] #> <frame 4> (3) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x3216920] #> #> [[39]] #> <frame 3> (2) #> expr: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), <...> #> env: [frame 0x3216c68] #> #> [[40]] #> <frame 2> (1) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [frame 0x3213180] #> #> [[41]] #> <frame 1> (0) #> expr: tryCatch(withCallingHandlers({ <...> #> env: [frame 0x32138f0] #> #> [[42]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "ctxt_stack" "stack"
f(f(call_stack()))
#> Warning: `call_stack()` is deprecated as of rlang 0.3.0. #> This warning is displayed once per session.
#> [[1]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x740b070] #> #> [[2]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x5e4f880] #> #> [[3]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x83b1810] #> #> [[4]] #> <frame 22> (21) #> expr: .f(code = .l[[1L]][[1L]], run = .l[[2L]][[1L]], show = .l[[3L]][[1L]], <...> #> env: [frame 0x83baa10] #> #> [[5]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x7d093a8] #> #> [[6]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x805df68] #> #> [[7]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x881d298] #> #> [[8]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x198d960] #> #> [[9]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x48b2d18] #> #> [[10]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x4bdc4d8] #> #> [[11]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x19009a0] #> #> [[12]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x19cd388] #> #> [[13]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x321df80] #> #> [[14]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "call_stack" "stack"
g <- function(cmd) cmd() f(g(ctxt_stack))
#> [[1]] #> <frame 40> (37) #> expr: g(ctxt_stack) #> env: [local 0x56167e0] #> #> [[2]] #> <frame 39> (38) #> expr: identity(x) #> env: [local 0x5616508] #> #> [[3]] #> <frame 38> (37) #> expr: f(g(ctxt_stack)) #> env: [local 0x56163f0] #> #> [[4]] #> <frame 37> (36) #> expr: eval(expr, envir, enclos) #> env: [local 0x740b070] #> #> [[5]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x5616150] #> #> [[6]] #> <frame 35> (26) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x5615e08] #> #> [[7]] #> <frame 34> (26) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x5619a88] #> #> [[8]] #> <frame 33> (32) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x563eba8] #> #> [[9]] #> <frame 32> (31) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x563e588] #> #> [[10]] #> <frame 31> (30) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x563e160] #> #> [[11]] #> <frame 30> (29) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x564aa90] #> #> [[12]] #> <frame 29> (28) #> expr: try(f, silent = TRUE) #> env: [local 0x564a860] #> #> [[13]] #> <frame 28> (26) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x564a630] #> #> [[14]] #> <frame 27> (26) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x564a400] #> #> [[15]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x572fe28] #> #> [[16]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x83b1810] #> #> [[17]] #> <frame 24> (23) #> expr: force(code) #> env: [frame 0x83b5df8] #> #> [[18]] #> <frame 23> (22) #> expr: withr::with_options(list(crayon.enabled = getOption("crayon.enabled", <...> #> env: [frame 0x83bc140] #> #> [[19]] #> <frame 22> (21) #> expr: .f(code = .l[[1L]][[1L]], run = .l[[2L]][[1L]], show = .l[[3L]][[1L]], <...> #> env: [frame 0x83baa10] #> #> [[20]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x7d093a8] #> #> [[21]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x805df68] #> #> [[22]] #> <frame 19> (18) #> expr: as_data(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x3e84c48] #> #> [[23]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x881d298] #> #> [[24]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x198d960] #> #> [[25]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x48b2d18] #> #> [[26]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x4bdc4d8] #> #> [[27]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x19009a0] #> #> [[28]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x19cd388] #> #> [[29]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x321df80] #> #> [[30]] #> <frame 11> (0) #> expr: (function (what, args, quote = FALSE, envir = parent.frame()) <...> #> env: [frame 0x321b110] #> #> [[31]] #> <frame 10> (0) #> expr: do.call(do.call, c(readRDS("/tmp/RtmpMVh6Pm/file4d004ee8fc43"), <...> #> env: [frame 0x3218f50] #> #> [[32]] #> <frame 9> (0) #> expr: saveRDS(do.call(do.call, c(readRDS("/tmp/RtmpMVh6Pm/file4d004ee8fc43"), <...> #> env: [frame 0x3219ce0] #> #> [[33]] #> <frame 8> (0) #> expr: withCallingHandlers({ <...> #> env: [frame 0x32188e8] #> #> [[34]] #> <frame 7> (6) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x3215c70] #> #> [[35]] #> <frame 6> (5) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [frame 0x3215fb8] #> #> [[36]] #> <frame 5> (2) #> expr: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) #> env: [frame 0x3216370] #> #> [[37]] #> <frame 4> (3) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x3216920] #> #> [[38]] #> <frame 3> (2) #> expr: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), <...> #> env: [frame 0x3216c68] #> #> [[39]] #> <frame 2> (1) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [frame 0x3213180] #> #> [[40]] #> <frame 1> (0) #> expr: tryCatch(withCallingHandlers({ <...> #> env: [frame 0x32138f0] #> #> [[41]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "ctxt_stack" "stack"
f(g(call_stack))
#> [[1]] #> <frame 40> (36) #> expr: g(call_stack) #> env: [local 0x19240d8] #> #> [[2]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x740b070] #> #> [[3]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x2d3e620] #> #> [[4]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x83b1810] #> #> [[5]] #> <frame 22> (21) #> expr: .f(code = .l[[1L]][[1L]], run = .l[[2L]][[1L]], show = .l[[3L]][[1L]], <...> #> env: [frame 0x83baa10] #> #> [[6]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x7d093a8] #> #> [[7]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x805df68] #> #> [[8]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x881d298] #> #> [[9]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x198d960] #> #> [[10]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x48b2d18] #> #> [[11]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x4bdc4d8] #> #> [[12]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x19009a0] #> #> [[13]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x19cd388] #> #> [[14]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x321df80] #> #> [[15]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "call_stack" "stack"
# The rlang _stack() functions return a list of frame # objects. Use purrr::transpose() or index a field with # purrr::map()'s to extract a particular field from a stack: # stack <- f(f(call_stack())) # purrr::map(stack, "env") # purrr::transpose(stack)$expr # current_frame() is an alias for ctxt_frame(1) fn <- function() list(current = current_frame(), first = ctxt_frame(1)) fn()
#> Warning: `current_frame()` is deprecated as of rlang 0.3.0. #> This warning is displayed once per session.
#> $current #> <frame 38> (37) #> expr: fn() #> env: [local 0x838ac88] #> #> $first #> <frame 38> (37) #> expr: fn() #> env: [local 0x838ac88] #>
# While current_frame() is the top of the stack, global_frame() is # the bottom: fn <- function() { n <- ctxt_depth() ctxt_frame(n) } identical(fn(), global_frame())
#> [1] TRUE
# ctxt_stack() returns a stack with all intervening frames. You can # trim layers of intervening frames with the trim argument: identity(identity(ctxt_stack()))
#> [[1]] #> <frame 39> (37) #> expr: identity(ctxt_stack()) #> env: [local 0x8e161b0] #> #> [[2]] #> <frame 38> (37) #> expr: identity(identity(ctxt_stack())) #> env: [local 0x8e162c8] #> #> [[3]] #> <frame 37> (36) #> expr: eval(expr, envir, enclos) #> env: [local 0x740b070] #> #> [[4]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x8e16488] #> #> [[5]] #> <frame 35> (26) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x8e166b8] #> #> [[6]] #> <frame 34> (26) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x8e16c68] #> #> [[7]] #> <frame 33> (32) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x8e133b0] #> #> [[8]] #> <frame 32> (31) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x8e136f8] #> #> [[9]] #> <frame 31> (30) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x8e13a40] #> #> [[10]] #> <frame 30> (29) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x8e14108] #> #> [[11]] #> <frame 29> (28) #> expr: try(f, silent = TRUE) #> env: [local 0x8e14338] #> #> [[12]] #> <frame 28> (26) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x8e144c0] #> #> [[13]] #> <frame 27> (26) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x8e145a0] #> #> [[14]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x78e9fa0] #> #> [[15]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x83b1810] #> #> [[16]] #> <frame 24> (23) #> expr: force(code) #> env: [frame 0x83b5df8] #> #> [[17]] #> <frame 23> (22) #> expr: withr::with_options(list(crayon.enabled = getOption("crayon.enabled", <...> #> env: [frame 0x83bc140] #> #> [[18]] #> <frame 22> (21) #> expr: .f(code = .l[[1L]][[1L]], run = .l[[2L]][[1L]], show = .l[[3L]][[1L]], <...> #> env: [frame 0x83baa10] #> #> [[19]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x7d093a8] #> #> [[20]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x805df68] #> #> [[21]] #> <frame 19> (18) #> expr: as_data(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x3e84c48] #> #> [[22]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x881d298] #> #> [[23]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x198d960] #> #> [[24]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x48b2d18] #> #> [[25]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x4bdc4d8] #> #> [[26]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x19009a0] #> #> [[27]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x19cd388] #> #> [[28]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x321df80] #> #> [[29]] #> <frame 11> (0) #> expr: (function (what, args, quote = FALSE, envir = parent.frame()) <...> #> env: [frame 0x321b110] #> #> [[30]] #> <frame 10> (0) #> expr: do.call(do.call, c(readRDS("/tmp/RtmpMVh6Pm/file4d004ee8fc43"), <...> #> env: [frame 0x3218f50] #> #> [[31]] #> <frame 9> (0) #> expr: saveRDS(do.call(do.call, c(readRDS("/tmp/RtmpMVh6Pm/file4d004ee8fc43"), <...> #> env: [frame 0x3219ce0] #> #> [[32]] #> <frame 8> (0) #> expr: withCallingHandlers({ <...> #> env: [frame 0x32188e8] #> #> [[33]] #> <frame 7> (6) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x3215c70] #> #> [[34]] #> <frame 6> (5) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [frame 0x3215fb8] #> #> [[35]] #> <frame 5> (2) #> expr: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) #> env: [frame 0x3216370] #> #> [[36]] #> <frame 4> (3) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x3216920] #> #> [[37]] #> <frame 3> (2) #> expr: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), <...> #> env: [frame 0x3216c68] #> #> [[38]] #> <frame 2> (1) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [frame 0x3213180] #> #> [[39]] #> <frame 1> (0) #> expr: tryCatch(withCallingHandlers({ <...> #> env: [frame 0x32138f0] #> #> [[40]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "ctxt_stack" "stack"
identity(identity(ctxt_stack(trim = 1)))
#> [[1]] #> <frame 37> (36) #> expr: eval(expr, envir, enclos) #> env: [local 0x740b070] #> #> [[2]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x7f386f8] #> #> [[3]] #> <frame 35> (26) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x7f384c8] #> #> [[4]] #> <frame 34> (26) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x7f37f18] #> #> [[5]] #> <frame 33> (32) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x7f379a0] #> #> [[6]] #> <frame 32> (31) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x7f37658] #> #> [[7]] #> <frame 31> (30) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x7f372d8] #> #> [[8]] #> <frame 30> (29) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x7ce2930] #> #> [[9]] #> <frame 29> (28) #> expr: try(f, silent = TRUE) #> env: [local 0x7ce2700] #> #> [[10]] #> <frame 28> (26) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x7ce2578] #> #> [[11]] #> <frame 27> (26) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x7ce2498] #> #> [[12]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x7f7cbd8] #> #> [[13]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x83b1810] #> #> [[14]] #> <frame 24> (23) #> expr: force(code) #> env: [frame 0x83b5df8] #> #> [[15]] #> <frame 23> (22) #> expr: withr::with_options(list(crayon.enabled = getOption("crayon.enabled", <...> #> env: [frame 0x83bc140] #> #> [[16]] #> <frame 22> (21) #> expr: .f(code = .l[[1L]][[1L]], run = .l[[2L]][[1L]], show = .l[[3L]][[1L]], <...> #> env: [frame 0x83baa10] #> #> [[17]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x7d093a8] #> #> [[18]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x805df68] #> #> [[19]] #> <frame 19> (18) #> expr: as_data(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x3e84c48] #> #> [[20]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x881d298] #> #> [[21]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x198d960] #> #> [[22]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x48b2d18] #> #> [[23]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x4bdc4d8] #> #> [[24]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x19009a0] #> #> [[25]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x19cd388] #> #> [[26]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x321df80] #> #> [[27]] #> <frame 11> (0) #> expr: (function (what, args, quote = FALSE, envir = parent.frame()) <...> #> env: [frame 0x321b110] #> #> [[28]] #> <frame 10> (0) #> expr: do.call(do.call, c(readRDS("/tmp/RtmpMVh6Pm/file4d004ee8fc43"), <...> #> env: [frame 0x3218f50] #> #> [[29]] #> <frame 9> (0) #> expr: saveRDS(do.call(do.call, c(readRDS("/tmp/RtmpMVh6Pm/file4d004ee8fc43"), <...> #> env: [frame 0x3219ce0] #> #> [[30]] #> <frame 8> (0) #> expr: withCallingHandlers({ <...> #> env: [frame 0x32188e8] #> #> [[31]] #> <frame 7> (6) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x3215c70] #> #> [[32]] #> <frame 6> (5) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [frame 0x3215fb8] #> #> [[33]] #> <frame 5> (2) #> expr: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) #> env: [frame 0x3216370] #> #> [[34]] #> <frame 4> (3) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x3216920] #> #> [[35]] #> <frame 3> (2) #> expr: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), <...> #> env: [frame 0x3216c68] #> #> [[36]] #> <frame 2> (1) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [frame 0x3213180] #> #> [[37]] #> <frame 1> (0) #> expr: tryCatch(withCallingHandlers({ <...> #> env: [frame 0x32138f0] #> #> [[38]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "ctxt_stack" "stack"
# ctxt_stack() is called within fn() with intervening frames: fn <- function(trim) identity(identity(ctxt_stack(trim = trim))) fn(0)
#> [[1]] #> <frame 40> (38) #> expr: identity(ctxt_stack(trim = trim)) #> env: [local 0x82b7f10] #> #> [[2]] #> <frame 39> (38) #> expr: identity(identity(ctxt_stack(trim = trim))) #> env: [local 0x82b7df8] #> #> [[3]] #> <frame 38> (37) #> expr: fn(0) #> env: [local 0x82b7ce0] #> #> [[4]] #> <frame 37> (36) #> expr: eval(expr, envir, enclos) #> env: [local 0x740b070] #> #> [[5]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x82b7ae8] #> #> [[6]] #> <frame 35> (26) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x82b78b8] #> #> [[7]] #> <frame 34> (26) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x82b7308] #> #> [[8]] #> <frame 33> (32) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x82b6d90] #> #> [[9]] #> <frame 32> (31) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x82b6a48] #> #> [[10]] #> <frame 31> (30) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x82fa770] #> #> [[11]] #> <frame 30> (29) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x82fa038] #> #> [[12]] #> <frame 29> (28) #> expr: try(f, silent = TRUE) #> env: [local 0x82f9e08] #> #> [[13]] #> <frame 28> (26) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x82f9c80] #> #> [[14]] #> <frame 27> (26) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x82f9ba0] #> #> [[15]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x83c9fc8] #> #> [[16]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x83b1810] #> #> [[17]] #> <frame 24> (23) #> expr: force(code) #> env: [frame 0x83b5df8] #> #> [[18]] #> <frame 23> (22) #> expr: withr::with_options(list(crayon.enabled = getOption("crayon.enabled", <...> #> env: [frame 0x83bc140] #> #> [[19]] #> <frame 22> (21) #> expr: .f(code = .l[[1L]][[1L]], run = .l[[2L]][[1L]], show = .l[[3L]][[1L]], <...> #> env: [frame 0x83baa10] #> #> [[20]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x7d093a8] #> #> [[21]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x805df68] #> #> [[22]] #> <frame 19> (18) #> expr: as_data(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x3e84c48] #> #> [[23]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x881d298] #> #> [[24]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x198d960] #> #> [[25]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x48b2d18] #> #> [[26]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x4bdc4d8] #> #> [[27]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x19009a0] #> #> [[28]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x19cd388] #> #> [[29]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x321df80] #> #> [[30]] #> <frame 11> (0) #> expr: (function (what, args, quote = FALSE, envir = parent.frame()) <...> #> env: [frame 0x321b110] #> #> [[31]] #> <frame 10> (0) #> expr: do.call(do.call, c(readRDS("/tmp/RtmpMVh6Pm/file4d004ee8fc43"), <...> #> env: [frame 0x3218f50] #> #> [[32]] #> <frame 9> (0) #> expr: saveRDS(do.call(do.call, c(readRDS("/tmp/RtmpMVh6Pm/file4d004ee8fc43"), <...> #> env: [frame 0x3219ce0] #> #> [[33]] #> <frame 8> (0) #> expr: withCallingHandlers({ <...> #> env: [frame 0x32188e8] #> #> [[34]] #> <frame 7> (6) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x3215c70] #> #> [[35]] #> <frame 6> (5) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [frame 0x3215fb8] #> #> [[36]] #> <frame 5> (2) #> expr: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) #> env: [frame 0x3216370] #> #> [[37]] #> <frame 4> (3) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x3216920] #> #> [[38]] #> <frame 3> (2) #> expr: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), <...> #> env: [frame 0x3216c68] #> #> [[39]] #> <frame 2> (1) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [frame 0x3213180] #> #> [[40]] #> <frame 1> (0) #> expr: tryCatch(withCallingHandlers({ <...> #> env: [frame 0x32138f0] #> #> [[41]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "ctxt_stack" "stack"
# We can trim the first layer of those: fn(1)
#> [[1]] #> <frame 38> (37) #> expr: fn(1) #> env: [local 0x5b6ed28] #> #> [[2]] #> <frame 37> (36) #> expr: eval(expr, envir, enclos) #> env: [local 0x740b070] #> #> [[3]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x5b6eb68] #> #> [[4]] #> <frame 35> (26) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x5b723b0] #> #> [[5]] #> <frame 34> (26) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x5b70c10] #> #> [[6]] #> <frame 33> (32) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x5b783b0] #> #> [[7]] #> <frame 32> (31) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x5b778c0] #> #> [[8]] #> <frame 31> (30) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x5b76eb0] #> #> [[9]] #> <frame 30> (29) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x5832a18] #> #> [[10]] #> <frame 29> (28) #> expr: try(f, silent = TRUE) #> env: [local 0x5832318] #> #> [[11]] #> <frame 28> (26) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x5831d30] #> #> [[12]] #> <frame 27> (26) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x5835620] #> #> [[13]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x50b2ec0] #> #> [[14]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x83b1810] #> #> [[15]] #> <frame 24> (23) #> expr: force(code) #> env: [frame 0x83b5df8] #> #> [[16]] #> <frame 23> (22) #> expr: withr::with_options(list(crayon.enabled = getOption("crayon.enabled", <...> #> env: [frame 0x83bc140] #> #> [[17]] #> <frame 22> (21) #> expr: .f(code = .l[[1L]][[1L]], run = .l[[2L]][[1L]], show = .l[[3L]][[1L]], <...> #> env: [frame 0x83baa10] #> #> [[18]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x7d093a8] #> #> [[19]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x805df68] #> #> [[20]] #> <frame 19> (18) #> expr: as_data(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x3e84c48] #> #> [[21]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x881d298] #> #> [[22]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x198d960] #> #> [[23]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x48b2d18] #> #> [[24]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x4bdc4d8] #> #> [[25]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x19009a0] #> #> [[26]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x19cd388] #> #> [[27]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x321df80] #> #> [[28]] #> <frame 11> (0) #> expr: (function (what, args, quote = FALSE, envir = parent.frame()) <...> #> env: [frame 0x321b110] #> #> [[29]] #> <frame 10> (0) #> expr: do.call(do.call, c(readRDS("/tmp/RtmpMVh6Pm/file4d004ee8fc43"), <...> #> env: [frame 0x3218f50] #> #> [[30]] #> <frame 9> (0) #> expr: saveRDS(do.call(do.call, c(readRDS("/tmp/RtmpMVh6Pm/file4d004ee8fc43"), <...> #> env: [frame 0x3219ce0] #> #> [[31]] #> <frame 8> (0) #> expr: withCallingHandlers({ <...> #> env: [frame 0x32188e8] #> #> [[32]] #> <frame 7> (6) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x3215c70] #> #> [[33]] #> <frame 6> (5) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [frame 0x3215fb8] #> #> [[34]] #> <frame 5> (2) #> expr: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) #> env: [frame 0x3216370] #> #> [[35]] #> <frame 4> (3) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x3216920] #> #> [[36]] #> <frame 3> (2) #> expr: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), <...> #> env: [frame 0x3216c68] #> #> [[37]] #> <frame 2> (1) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [frame 0x3213180] #> #> [[38]] #> <frame 1> (0) #> expr: tryCatch(withCallingHandlers({ <...> #> env: [frame 0x32138f0] #> #> [[39]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "ctxt_stack" "stack"
# The outside intervening frames (at the fn() call site) are still # returned, but can be trimmed as well: identity(identity(fn(1)))
#> [[1]] #> <frame 40> (37) #> expr: fn(1) #> env: [local 0x4f51648] #> #> [[2]] #> <frame 39> (37) #> expr: identity(fn(1)) #> env: [local 0x4f53fe8] #> #> [[3]] #> <frame 38> (37) #> expr: identity(identity(fn(1))) #> env: [local 0x4f52f80] #> #> [[4]] #> <frame 37> (36) #> expr: eval(expr, envir, enclos) #> env: [local 0x740b070] #> #> [[5]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x4f553e0] #> #> [[6]] #> <frame 35> (26) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x4f5a720] #> #> [[7]] #> <frame 34> (26) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x4f59bc0] #> #> [[8]] #> <frame 33> (32) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x4f591e8] #> #> [[9]] #> <frame 32> (31) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x4f58d88] #> #> [[10]] #> <frame 31> (30) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x4f58928] #> #> [[11]] #> <frame 30> (29) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x4f5be60] #> #> [[12]] #> <frame 29> (28) #> expr: try(f, silent = TRUE) #> env: [local 0x4f5bb88] #> #> [[13]] #> <frame 28> (26) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x4f5b990] #> #> [[14]] #> <frame 27> (26) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x4f5b840] #> #> [[15]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x5138638] #> #> [[16]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x83b1810] #> #> [[17]] #> <frame 24> (23) #> expr: force(code) #> env: [frame 0x83b5df8] #> #> [[18]] #> <frame 23> (22) #> expr: withr::with_options(list(crayon.enabled = getOption("crayon.enabled", <...> #> env: [frame 0x83bc140] #> #> [[19]] #> <frame 22> (21) #> expr: .f(code = .l[[1L]][[1L]], run = .l[[2L]][[1L]], show = .l[[3L]][[1L]], <...> #> env: [frame 0x83baa10] #> #> [[20]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x7d093a8] #> #> [[21]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x805df68] #> #> [[22]] #> <frame 19> (18) #> expr: as_data(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x3e84c48] #> #> [[23]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x881d298] #> #> [[24]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x198d960] #> #> [[25]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x48b2d18] #> #> [[26]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x4bdc4d8] #> #> [[27]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x19009a0] #> #> [[28]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x19cd388] #> #> [[29]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x321df80] #> #> [[30]] #> <frame 11> (0) #> expr: (function (what, args, quote = FALSE, envir = parent.frame()) <...> #> env: [frame 0x321b110] #> #> [[31]] #> <frame 10> (0) #> expr: do.call(do.call, c(readRDS("/tmp/RtmpMVh6Pm/file4d004ee8fc43"), <...> #> env: [frame 0x3218f50] #> #> [[32]] #> <frame 9> (0) #> expr: saveRDS(do.call(do.call, c(readRDS("/tmp/RtmpMVh6Pm/file4d004ee8fc43"), <...> #> env: [frame 0x3219ce0] #> #> [[33]] #> <frame 8> (0) #> expr: withCallingHandlers({ <...> #> env: [frame 0x32188e8] #> #> [[34]] #> <frame 7> (6) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x3215c70] #> #> [[35]] #> <frame 6> (5) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [frame 0x3215fb8] #> #> [[36]] #> <frame 5> (2) #> expr: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) #> env: [frame 0x3216370] #> #> [[37]] #> <frame 4> (3) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x3216920] #> #> [[38]] #> <frame 3> (2) #> expr: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), <...> #> env: [frame 0x3216c68] #> #> [[39]] #> <frame 2> (1) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [frame 0x3213180] #> #> [[40]] #> <frame 1> (0) #> expr: tryCatch(withCallingHandlers({ <...> #> env: [frame 0x32138f0] #> #> [[41]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "ctxt_stack" "stack"
#> [[1]] #> <frame 37> (36) #> expr: eval(expr, envir, enclos) #> env: [local 0x740b070] #> #> [[2]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x2ef8ac8] #> #> [[3]] #> <frame 35> (26) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x2ef8828] #> #> [[4]] #> <frame 34> (26) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x2ef80b8] #> #> [[5]] #> <frame 33> (32) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x2dd3c80] #> #> [[6]] #> <frame 32> (31) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x2dd3820] #> #> [[7]] #> <frame 31> (30) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x2dd3468] #> #> [[8]] #> <frame 30> (29) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x2dd2cc0] #> #> [[9]] #> <frame 29> (28) #> expr: try(f, silent = TRUE) #> env: [local 0x2dd29e8] #> #> [[10]] #> <frame 28> (26) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x2dd2828] #> #> [[11]] #> <frame 27> (26) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x2dd2748] #> #> [[12]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x2dac420] #> #> [[13]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x83b1810] #> #> [[14]] #> <frame 24> (23) #> expr: force(code) #> env: [frame 0x83b5df8] #> #> [[15]] #> <frame 23> (22) #> expr: withr::with_options(list(crayon.enabled = getOption("crayon.enabled", <...> #> env: [frame 0x83bc140] #> #> [[16]] #> <frame 22> (21) #> expr: .f(code = .l[[1L]][[1L]], run = .l[[2L]][[1L]], show = .l[[3L]][[1L]], <...> #> env: [frame 0x83baa10] #> #> [[17]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x7d093a8] #> #> [[18]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x805df68] #> #> [[19]] #> <frame 19> (18) #> expr: as_data(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x3e84c48] #> #> [[20]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x881d298] #> #> [[21]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x198d960] #> #> [[22]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x48b2d18] #> #> [[23]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x4bdc4d8] #> #> [[24]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x19009a0] #> #> [[25]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x19cd388] #> #> [[26]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x321df80] #> #> [[27]] #> <frame 11> (0) #> expr: (function (what, args, quote = FALSE, envir = parent.frame()) <...> #> env: [frame 0x321b110] #> #> [[28]] #> <frame 10> (0) #> expr: do.call(do.call, c(readRDS("/tmp/RtmpMVh6Pm/file4d004ee8fc43"), <...> #> env: [frame 0x3218f50] #> #> [[29]] #> <frame 9> (0) #> expr: saveRDS(do.call(do.call, c(readRDS("/tmp/RtmpMVh6Pm/file4d004ee8fc43"), <...> #> env: [frame 0x3219ce0] #> #> [[30]] #> <frame 8> (0) #> expr: withCallingHandlers({ <...> #> env: [frame 0x32188e8] #> #> [[31]] #> <frame 7> (6) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x3215c70] #> #> [[32]] #> <frame 6> (5) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [frame 0x3215fb8] #> #> [[33]] #> <frame 5> (2) #> expr: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) #> env: [frame 0x3216370] #> #> [[34]] #> <frame 4> (3) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x3216920] #> #> [[35]] #> <frame 3> (2) #> expr: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), <...> #> env: [frame 0x3216c68] #> #> [[36]] #> <frame 2> (1) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [frame 0x3213180] #> #> [[37]] #> <frame 1> (0) #> expr: tryCatch(withCallingHandlers({ <...> #> env: [frame 0x32138f0] #> #> [[38]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "ctxt_stack" "stack"
g <- function(trim) identity(identity(fn(trim))) g(2)
#> [[1]] #> <frame 38> (37) #> expr: g(2) #> env: [local 0x8029ca0] #> #> [[2]] #> <frame 37> (36) #> expr: eval(expr, envir, enclos) #> env: [local 0x740b070] #> #> [[3]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x8029e60] #> #> [[4]] #> <frame 35> (26) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x802a090] #> #> [[5]] #> <frame 34> (26) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x802a640] #> #> [[6]] #> <frame 33> (32) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x8d5f038] #> #> [[7]] #> <frame 32> (31) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x8d5f380] #> #> [[8]] #> <frame 31> (30) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x8d5f6c8] #> #> [[9]] #> <frame 30> (29) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x8d5fdc8] #> #> [[10]] #> <frame 29> (28) #> expr: try(f, silent = TRUE) #> env: [local 0x8d603b0] #> #> [[11]] #> <frame 28> (26) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x8d60538] #> #> [[12]] #> <frame 27> (26) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x8d60618] #> #> [[13]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x81809d0] #> #> [[14]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x83b1810] #> #> [[15]] #> <frame 24> (23) #> expr: force(code) #> env: [frame 0x83b5df8] #> #> [[16]] #> <frame 23> (22) #> expr: withr::with_options(list(crayon.enabled = getOption("crayon.enabled", <...> #> env: [frame 0x83bc140] #> #> [[17]] #> <frame 22> (21) #> expr: .f(code = .l[[1L]][[1L]], run = .l[[2L]][[1L]], show = .l[[3L]][[1L]], <...> #> env: [frame 0x83baa10] #> #> [[18]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x7d093a8] #> #> [[19]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x805df68] #> #> [[20]] #> <frame 19> (18) #> expr: as_data(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x3e84c48] #> #> [[21]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x881d298] #> #> [[22]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x198d960] #> #> [[23]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x48b2d18] #> #> [[24]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x4bdc4d8] #> #> [[25]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x19009a0] #> #> [[26]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x19cd388] #> #> [[27]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x321df80] #> #> [[28]] #> <frame 11> (0) #> expr: (function (what, args, quote = FALSE, envir = parent.frame()) <...> #> env: [frame 0x321b110] #> #> [[29]] #> <frame 10> (0) #> expr: do.call(do.call, c(readRDS("/tmp/RtmpMVh6Pm/file4d004ee8fc43"), <...> #> env: [frame 0x3218f50] #> #> [[30]] #> <frame 9> (0) #> expr: saveRDS(do.call(do.call, c(readRDS("/tmp/RtmpMVh6Pm/file4d004ee8fc43"), <...> #> env: [frame 0x3219ce0] #> #> [[31]] #> <frame 8> (0) #> expr: withCallingHandlers({ <...> #> env: [frame 0x32188e8] #> #> [[32]] #> <frame 7> (6) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x3215c70] #> #> [[33]] #> <frame 6> (5) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [frame 0x3215fb8] #> #> [[34]] #> <frame 5> (2) #> expr: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) #> env: [frame 0x3216370] #> #> [[35]] #> <frame 4> (3) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x3216920] #> #> [[36]] #> <frame 3> (2) #> expr: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), <...> #> env: [frame 0x3216c68] #> #> [[37]] #> <frame 2> (1) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [frame 0x3213180] #> #> [[38]] #> <frame 1> (0) #> expr: tryCatch(withCallingHandlers({ <...> #> env: [frame 0x32138f0] #> #> [[39]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "ctxt_stack" "stack"
g(3)
#> [[1]] #> <frame 37> (36) #> expr: eval(expr, envir, enclos) #> env: [local 0x740b070] #> #> [[2]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x91d60d0] #> #> [[3]] #> <frame 35> (26) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x91d6530] #> #> [[4]] #> <frame 34> (26) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x91d2dc8] #> #> [[5]] #> <frame 33> (32) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x91d3bc8] #> #> [[6]] #> <frame 32> (31) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x91d41b0] #> #> [[7]] #> <frame 31> (30) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x91d4568] #> #> [[8]] #> <frame 30> (29) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x9067200] #> #> [[9]] #> <frame 29> (28) #> expr: try(f, silent = TRUE) #> env: [local 0x9067430] #> #> [[10]] #> <frame 28> (26) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x90675f0] #> #> [[11]] #> <frame 27> (26) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x90676d0] #> #> [[12]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x909a000] #> #> [[13]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x83b1810] #> #> [[14]] #> <frame 24> (23) #> expr: force(code) #> env: [frame 0x83b5df8] #> #> [[15]] #> <frame 23> (22) #> expr: withr::with_options(list(crayon.enabled = getOption("crayon.enabled", <...> #> env: [frame 0x83bc140] #> #> [[16]] #> <frame 22> (21) #> expr: .f(code = .l[[1L]][[1L]], run = .l[[2L]][[1L]], show = .l[[3L]][[1L]], <...> #> env: [frame 0x83baa10] #> #> [[17]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x7d093a8] #> #> [[18]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x805df68] #> #> [[19]] #> <frame 19> (18) #> expr: as_data(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x3e84c48] #> #> [[20]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x881d298] #> #> [[21]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x198d960] #> #> [[22]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x48b2d18] #> #> [[23]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x4bdc4d8] #> #> [[24]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x19009a0] #> #> [[25]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x19cd388] #> #> [[26]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x321df80] #> #> [[27]] #> <frame 11> (0) #> expr: (function (what, args, quote = FALSE, envir = parent.frame()) <...> #> env: [frame 0x321b110] #> #> [[28]] #> <frame 10> (0) #> expr: do.call(do.call, c(readRDS("/tmp/RtmpMVh6Pm/file4d004ee8fc43"), <...> #> env: [frame 0x3218f50] #> #> [[29]] #> <frame 9> (0) #> expr: saveRDS(do.call(do.call, c(readRDS("/tmp/RtmpMVh6Pm/file4d004ee8fc43"), <...> #> env: [frame 0x3219ce0] #> #> [[30]] #> <frame 8> (0) #> expr: withCallingHandlers({ <...> #> env: [frame 0x32188e8] #> #> [[31]] #> <frame 7> (6) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x3215c70] #> #> [[32]] #> <frame 6> (5) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [frame 0x3215fb8] #> #> [[33]] #> <frame 5> (2) #> expr: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) #> env: [frame 0x3216370] #> #> [[34]] #> <frame 4> (3) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x3216920] #> #> [[35]] #> <frame 3> (2) #> expr: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), <...> #> env: [frame 0x3216c68] #> #> [[36]] #> <frame 2> (1) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [frame 0x3213180] #> #> [[37]] #> <frame 1> (0) #> expr: tryCatch(withCallingHandlers({ <...> #> env: [frame 0x32138f0] #> #> [[38]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "ctxt_stack" "stack"