Soft-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
#> [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
#> [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 0x5eec7b8] #> #> [[2]] #> <frame 40> (37) #> expr: f(ctxt_stack()) #> env: [local 0x5eeb830] #> #> [[3]] #> <frame 39> (38) #> expr: identity(x) #> env: [local 0x5eeb6e0] #> #> [[4]] #> <frame 38> (37) #> expr: f(f(ctxt_stack())) #> env: [local 0x5eeb5c8] #> #> [[5]] #> <frame 37> (36) #> expr: eval(expr, envir, enclos) #> env: [local 0x6291920] #> #> [[6]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x5eeb3d0] #> #> [[7]] #> <frame 35> (26) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x5eeb1a0] #> #> [[8]] #> <frame 34> (26) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x5eee908] #> #> [[9]] #> <frame 33> (32) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x5eee390] #> #> [[10]] #> <frame 32> (31) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x5eee048] #> #> [[11]] #> <frame 31> (30) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x5eedcc8] #> #> [[12]] #> <frame 30> (29) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x5eed558] #> #> [[13]] #> <frame 29> (28) #> expr: try(f, silent = TRUE) #> env: [local 0x5eed328] #> #> [[14]] #> <frame 28> (26) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x5eed1a0] #> #> [[15]] #> <frame 27> (26) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x5eed088] #> #> [[16]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x5f22838] #> #> [[17]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x8a4bbe0] #> #> [[18]] #> <frame 24> (23) #> expr: force(code) #> env: [frame 0x8a510e0] #> #> [[19]] #> <frame 23> (22) #> expr: withr::with_options(list(crayon.enabled = getOption("crayon.enabled", <...> #> env: [frame 0x8a544b0] #> #> [[20]] #> <frame 22> (21) #> expr: .f(code = .l[[c(1L, 1L)]], run = .l[[c(2L, 1L)]], show = .l[[c(3L, <...> #> env: [frame 0x8a57450] #> #> [[21]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x8b02658] #> #> [[22]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x7d54f30] #> #> [[23]] #> <frame 19> (18) #> expr: as_data(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x7d54590] #> #> [[24]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x800ba88] #> #> [[25]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x86cac78] #> #> [[26]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x79ae7d0] #> #> [[27]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x5078448] #> #> [[28]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x1ebac98] #> #> [[29]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x1b2ad48] #> #> [[30]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x36f02d0] #> #> [[31]] #> <frame 11> (0) #> expr: (function (what, args, quote = FALSE, envir = parent.frame()) <...> #> env: [frame 0x36f1290] #> #> [[32]] #> <frame 10> (0) #> expr: do.call(do.call, c(readRDS("/tmp/RtmpnyPeIi/file43227a57ff01"), <...> #> env: [frame 0x36e10f0] #> #> [[33]] #> <frame 9> (0) #> expr: saveRDS(do.call(do.call, c(readRDS("/tmp/RtmpnyPeIi/file43227a57ff01"), <...> #> env: [frame 0x36e1e80] #> #> [[34]] #> <frame 8> (0) #> expr: withCallingHandlers({ <...> #> env: [frame 0x36dcc58] #> #> [[35]] #> <frame 7> (6) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x36dde10] #> #> [[36]] #> <frame 6> (5) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [frame 0x36de158] #> #> [[37]] #> <frame 5> (2) #> expr: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) #> env: [frame 0x36da6e0] #> #> [[38]] #> <frame 4> (3) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x36dac90] #> #> [[39]] #> <frame 3> (2) #> expr: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), <...> #> env: [frame 0x36dafd8] #> #> [[40]] #> <frame 2> (1) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [frame 0x36db320] #> #> [[41]] #> <frame 1> (0) #> expr: tryCatch(withCallingHandlers({ <...> #> env: [frame 0x36dba90] #> #> [[42]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "ctxt_stack" "stack"
f(f(call_stack()))
#> [[1]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x6291920] #> #> [[2]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x4629980] #> #> [[3]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x8a4bbe0] #> #> [[4]] #> <frame 22> (21) #> expr: .f(code = .l[[c(1L, 1L)]], run = .l[[c(2L, 1L)]], show = .l[[c(3L, <...> #> env: [frame 0x8a57450] #> #> [[5]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x8b02658] #> #> [[6]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x7d54f30] #> #> [[7]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x800ba88] #> #> [[8]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x86cac78] #> #> [[9]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x79ae7d0] #> #> [[10]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x5078448] #> #> [[11]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x1ebac98] #> #> [[12]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x1b2ad48] #> #> [[13]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x36f02d0] #> #> [[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 0x1fad368] #> #> [[2]] #> <frame 39> (38) #> expr: identity(x) #> env: [local 0x1fad1e0] #> #> [[3]] #> <frame 38> (37) #> expr: f(g(ctxt_stack)) #> env: [local 0x1fad0c8] #> #> [[4]] #> <frame 37> (36) #> expr: eval(expr, envir, enclos) #> env: [local 0x6291920] #> #> [[5]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x1face28] #> #> [[6]] #> <frame 35> (26) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x1facbf8] #> #> [[7]] #> <frame 34> (26) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x1fac488] #> #> [[8]] #> <frame 33> (32) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x1f9d7a0] #> #> [[9]] #> <frame 32> (31) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x1f9ce70] #> #> [[10]] #> <frame 31> (30) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x1f9c658] #> #> [[11]] #> <frame 30> (29) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x1f9f768] #> #> [[12]] #> <frame 29> (28) #> expr: try(f, silent = TRUE) #> env: [local 0x1f9f030] #> #> [[13]] #> <frame 28> (26) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x1f9edc8] #> #> [[14]] #> <frame 27> (26) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x1f9ece8] #> #> [[15]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x32a6368] #> #> [[16]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x8a4bbe0] #> #> [[17]] #> <frame 24> (23) #> expr: force(code) #> env: [frame 0x8a510e0] #> #> [[18]] #> <frame 23> (22) #> expr: withr::with_options(list(crayon.enabled = getOption("crayon.enabled", <...> #> env: [frame 0x8a544b0] #> #> [[19]] #> <frame 22> (21) #> expr: .f(code = .l[[c(1L, 1L)]], run = .l[[c(2L, 1L)]], show = .l[[c(3L, <...> #> env: [frame 0x8a57450] #> #> [[20]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x8b02658] #> #> [[21]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x7d54f30] #> #> [[22]] #> <frame 19> (18) #> expr: as_data(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x7d54590] #> #> [[23]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x800ba88] #> #> [[24]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x86cac78] #> #> [[25]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x79ae7d0] #> #> [[26]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x5078448] #> #> [[27]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x1ebac98] #> #> [[28]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x1b2ad48] #> #> [[29]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x36f02d0] #> #> [[30]] #> <frame 11> (0) #> expr: (function (what, args, quote = FALSE, envir = parent.frame()) <...> #> env: [frame 0x36f1290] #> #> [[31]] #> <frame 10> (0) #> expr: do.call(do.call, c(readRDS("/tmp/RtmpnyPeIi/file43227a57ff01"), <...> #> env: [frame 0x36e10f0] #> #> [[32]] #> <frame 9> (0) #> expr: saveRDS(do.call(do.call, c(readRDS("/tmp/RtmpnyPeIi/file43227a57ff01"), <...> #> env: [frame 0x36e1e80] #> #> [[33]] #> <frame 8> (0) #> expr: withCallingHandlers({ <...> #> env: [frame 0x36dcc58] #> #> [[34]] #> <frame 7> (6) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x36dde10] #> #> [[35]] #> <frame 6> (5) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [frame 0x36de158] #> #> [[36]] #> <frame 5> (2) #> expr: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) #> env: [frame 0x36da6e0] #> #> [[37]] #> <frame 4> (3) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x36dac90] #> #> [[38]] #> <frame 3> (2) #> expr: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), <...> #> env: [frame 0x36dafd8] #> #> [[39]] #> <frame 2> (1) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [frame 0x36db320] #> #> [[40]] #> <frame 1> (0) #> expr: tryCatch(withCallingHandlers({ <...> #> env: [frame 0x36dba90] #> #> [[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 0x71dd008] #> #> [[2]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x6291920] #> #> [[3]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x8a0e020] #> #> [[4]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x8a4bbe0] #> #> [[5]] #> <frame 22> (21) #> expr: .f(code = .l[[c(1L, 1L)]], run = .l[[c(2L, 1L)]], show = .l[[c(3L, <...> #> env: [frame 0x8a57450] #> #> [[6]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x8b02658] #> #> [[7]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x7d54f30] #> #> [[8]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x800ba88] #> #> [[9]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x86cac78] #> #> [[10]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x79ae7d0] #> #> [[11]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x5078448] #> #> [[12]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x1ebac98] #> #> [[13]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x1b2ad48] #> #> [[14]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x36f02d0] #> #> [[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()
#> $current #> <frame 38> (37) #> expr: fn() #> env: [local 0x7dba3a0] #> #> $first #> <frame 38> (37) #> expr: fn() #> env: [local 0x7dba3a0] #>
# 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 0x848b338] #> #> [[2]] #> <frame 38> (37) #> expr: identity(identity(ctxt_stack())) #> env: [local 0x848b1b0] #> #> [[3]] #> <frame 37> (36) #> expr: eval(expr, envir, enclos) #> env: [local 0x6291920] #> #> [[4]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x848afb8] #> #> [[5]] #> <frame 35> (26) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x848ad88] #> #> [[6]] #> <frame 34> (26) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x848a7d8] #> #> [[7]] #> <frame 33> (32) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x848a260] #> #> [[8]] #> <frame 32> (31) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x8489f18] #> #> [[9]] #> <frame 31> (30) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x8489bd0] #> #> [[10]] #> <frame 30> (29) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x8489498] #> #> [[11]] #> <frame 29> (28) #> expr: try(f, silent = TRUE) #> env: [local 0x8490ed8] #> #> [[12]] #> <frame 28> (26) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x8490d50] #> #> [[13]] #> <frame 27> (26) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x8490c70] #> #> [[14]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x8569c38] #> #> [[15]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x8a4bbe0] #> #> [[16]] #> <frame 24> (23) #> expr: force(code) #> env: [frame 0x8a510e0] #> #> [[17]] #> <frame 23> (22) #> expr: withr::with_options(list(crayon.enabled = getOption("crayon.enabled", <...> #> env: [frame 0x8a544b0] #> #> [[18]] #> <frame 22> (21) #> expr: .f(code = .l[[c(1L, 1L)]], run = .l[[c(2L, 1L)]], show = .l[[c(3L, <...> #> env: [frame 0x8a57450] #> #> [[19]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x8b02658] #> #> [[20]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x7d54f30] #> #> [[21]] #> <frame 19> (18) #> expr: as_data(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x7d54590] #> #> [[22]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x800ba88] #> #> [[23]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x86cac78] #> #> [[24]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x79ae7d0] #> #> [[25]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x5078448] #> #> [[26]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x1ebac98] #> #> [[27]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x1b2ad48] #> #> [[28]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x36f02d0] #> #> [[29]] #> <frame 11> (0) #> expr: (function (what, args, quote = FALSE, envir = parent.frame()) <...> #> env: [frame 0x36f1290] #> #> [[30]] #> <frame 10> (0) #> expr: do.call(do.call, c(readRDS("/tmp/RtmpnyPeIi/file43227a57ff01"), <...> #> env: [frame 0x36e10f0] #> #> [[31]] #> <frame 9> (0) #> expr: saveRDS(do.call(do.call, c(readRDS("/tmp/RtmpnyPeIi/file43227a57ff01"), <...> #> env: [frame 0x36e1e80] #> #> [[32]] #> <frame 8> (0) #> expr: withCallingHandlers({ <...> #> env: [frame 0x36dcc58] #> #> [[33]] #> <frame 7> (6) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x36dde10] #> #> [[34]] #> <frame 6> (5) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [frame 0x36de158] #> #> [[35]] #> <frame 5> (2) #> expr: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) #> env: [frame 0x36da6e0] #> #> [[36]] #> <frame 4> (3) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x36dac90] #> #> [[37]] #> <frame 3> (2) #> expr: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), <...> #> env: [frame 0x36dafd8] #> #> [[38]] #> <frame 2> (1) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [frame 0x36db320] #> #> [[39]] #> <frame 1> (0) #> expr: tryCatch(withCallingHandlers({ <...> #> env: [frame 0x36dba90] #> #> [[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 0x6291920] #> #> [[2]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x6250058] #> #> [[3]] #> <frame 35> (26) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x624fe28] #> #> [[4]] #> <frame 34> (26) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x624f808] #> #> [[5]] #> <frame 33> (32) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x624f258] #> #> [[6]] #> <frame 32> (31) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x624ea08] #> #> [[7]] #> <frame 31> (30) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x62524b8] #> #> [[8]] #> <frame 30> (29) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x6251ae0] #> #> [[9]] #> <frame 29> (28) #> expr: try(f, silent = TRUE) #> env: [local 0x6251760] #> #> [[10]] #> <frame 28> (26) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x6251568] #> #> [[11]] #> <frame 27> (26) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x6251488] #> #> [[12]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x62989b0] #> #> [[13]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x8a4bbe0] #> #> [[14]] #> <frame 24> (23) #> expr: force(code) #> env: [frame 0x8a510e0] #> #> [[15]] #> <frame 23> (22) #> expr: withr::with_options(list(crayon.enabled = getOption("crayon.enabled", <...> #> env: [frame 0x8a544b0] #> #> [[16]] #> <frame 22> (21) #> expr: .f(code = .l[[c(1L, 1L)]], run = .l[[c(2L, 1L)]], show = .l[[c(3L, <...> #> env: [frame 0x8a57450] #> #> [[17]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x8b02658] #> #> [[18]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x7d54f30] #> #> [[19]] #> <frame 19> (18) #> expr: as_data(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x7d54590] #> #> [[20]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x800ba88] #> #> [[21]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x86cac78] #> #> [[22]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x79ae7d0] #> #> [[23]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x5078448] #> #> [[24]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x1ebac98] #> #> [[25]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x1b2ad48] #> #> [[26]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x36f02d0] #> #> [[27]] #> <frame 11> (0) #> expr: (function (what, args, quote = FALSE, envir = parent.frame()) <...> #> env: [frame 0x36f1290] #> #> [[28]] #> <frame 10> (0) #> expr: do.call(do.call, c(readRDS("/tmp/RtmpnyPeIi/file43227a57ff01"), <...> #> env: [frame 0x36e10f0] #> #> [[29]] #> <frame 9> (0) #> expr: saveRDS(do.call(do.call, c(readRDS("/tmp/RtmpnyPeIi/file43227a57ff01"), <...> #> env: [frame 0x36e1e80] #> #> [[30]] #> <frame 8> (0) #> expr: withCallingHandlers({ <...> #> env: [frame 0x36dcc58] #> #> [[31]] #> <frame 7> (6) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x36dde10] #> #> [[32]] #> <frame 6> (5) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [frame 0x36de158] #> #> [[33]] #> <frame 5> (2) #> expr: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) #> env: [frame 0x36da6e0] #> #> [[34]] #> <frame 4> (3) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x36dac90] #> #> [[35]] #> <frame 3> (2) #> expr: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), <...> #> env: [frame 0x36dafd8] #> #> [[36]] #> <frame 2> (1) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [frame 0x36db320] #> #> [[37]] #> <frame 1> (0) #> expr: tryCatch(withCallingHandlers({ <...> #> env: [frame 0x36dba90] #> #> [[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 0x4fa4840] #> #> [[2]] #> <frame 39> (38) #> expr: identity(identity(ctxt_stack(trim = trim))) #> env: [local 0x4fa4300] #> #> [[3]] #> <frame 38> (37) #> expr: fn(0) #> env: [local 0x4fa3bc8] #> #> [[4]] #> <frame 37> (36) #> expr: eval(expr, envir, enclos) #> env: [local 0x6291920] #> #> [[5]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x4fa35a8] #> #> [[6]] #> <frame 35> (26) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x4fa3228] #> #> [[7]] #> <frame 34> (26) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x4fa6178] #> #> [[8]] #> <frame 33> (32) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x4fa5458] #> #> [[9]] #> <frame 32> (31) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x4fa4d20] #> #> [[10]] #> <frame 31> (30) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x4fa7ff0] #> #> [[11]] #> <frame 30> (29) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x4fa6e70] #> #> [[12]] #> <frame 29> (28) #> expr: try(f, silent = TRUE) #> env: [local 0x4faa108] #> #> [[13]] #> <frame 28> (26) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x4fa8dc8] #> #> [[14]] #> <frame 27> (26) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x4fac4f8] #> #> [[15]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x4ffb2a8] #> #> [[16]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x8a4bbe0] #> #> [[17]] #> <frame 24> (23) #> expr: force(code) #> env: [frame 0x8a510e0] #> #> [[18]] #> <frame 23> (22) #> expr: withr::with_options(list(crayon.enabled = getOption("crayon.enabled", <...> #> env: [frame 0x8a544b0] #> #> [[19]] #> <frame 22> (21) #> expr: .f(code = .l[[c(1L, 1L)]], run = .l[[c(2L, 1L)]], show = .l[[c(3L, <...> #> env: [frame 0x8a57450] #> #> [[20]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x8b02658] #> #> [[21]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x7d54f30] #> #> [[22]] #> <frame 19> (18) #> expr: as_data(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x7d54590] #> #> [[23]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x800ba88] #> #> [[24]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x86cac78] #> #> [[25]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x79ae7d0] #> #> [[26]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x5078448] #> #> [[27]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x1ebac98] #> #> [[28]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x1b2ad48] #> #> [[29]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x36f02d0] #> #> [[30]] #> <frame 11> (0) #> expr: (function (what, args, quote = FALSE, envir = parent.frame()) <...> #> env: [frame 0x36f1290] #> #> [[31]] #> <frame 10> (0) #> expr: do.call(do.call, c(readRDS("/tmp/RtmpnyPeIi/file43227a57ff01"), <...> #> env: [frame 0x36e10f0] #> #> [[32]] #> <frame 9> (0) #> expr: saveRDS(do.call(do.call, c(readRDS("/tmp/RtmpnyPeIi/file43227a57ff01"), <...> #> env: [frame 0x36e1e80] #> #> [[33]] #> <frame 8> (0) #> expr: withCallingHandlers({ <...> #> env: [frame 0x36dcc58] #> #> [[34]] #> <frame 7> (6) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x36dde10] #> #> [[35]] #> <frame 6> (5) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [frame 0x36de158] #> #> [[36]] #> <frame 5> (2) #> expr: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) #> env: [frame 0x36da6e0] #> #> [[37]] #> <frame 4> (3) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x36dac90] #> #> [[38]] #> <frame 3> (2) #> expr: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), <...> #> env: [frame 0x36dafd8] #> #> [[39]] #> <frame 2> (1) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [frame 0x36db320] #> #> [[40]] #> <frame 1> (0) #> expr: tryCatch(withCallingHandlers({ <...> #> env: [frame 0x36dba90] #> #> [[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 0x3319cc0] #> #> [[2]] #> <frame 37> (36) #> expr: eval(expr, envir, enclos) #> env: [local 0x6291920] #> #> [[3]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x3319ac8] #> #> [[4]] #> <frame 35> (26) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x331f2d8] #> #> [[5]] #> <frame 34> (26) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x331e970] #> #> [[6]] #> <frame 33> (32) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x331e318] #> #> [[7]] #> <frame 32> (31) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x331def0] #> #> [[8]] #> <frame 31> (30) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x331db38] #> #> [[9]] #> <frame 30> (29) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x3339ac8] #> #> [[10]] #> <frame 29> (28) #> expr: try(f, silent = TRUE) #> env: [local 0x3339828] #> #> [[11]] #> <frame 28> (26) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x3339518] #> #> [[12]] #> <frame 27> (26) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x33391d0] #> #> [[13]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x337ac38] #> #> [[14]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x8a4bbe0] #> #> [[15]] #> <frame 24> (23) #> expr: force(code) #> env: [frame 0x8a510e0] #> #> [[16]] #> <frame 23> (22) #> expr: withr::with_options(list(crayon.enabled = getOption("crayon.enabled", <...> #> env: [frame 0x8a544b0] #> #> [[17]] #> <frame 22> (21) #> expr: .f(code = .l[[c(1L, 1L)]], run = .l[[c(2L, 1L)]], show = .l[[c(3L, <...> #> env: [frame 0x8a57450] #> #> [[18]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x8b02658] #> #> [[19]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x7d54f30] #> #> [[20]] #> <frame 19> (18) #> expr: as_data(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x7d54590] #> #> [[21]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x800ba88] #> #> [[22]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x86cac78] #> #> [[23]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x79ae7d0] #> #> [[24]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x5078448] #> #> [[25]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x1ebac98] #> #> [[26]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x1b2ad48] #> #> [[27]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x36f02d0] #> #> [[28]] #> <frame 11> (0) #> expr: (function (what, args, quote = FALSE, envir = parent.frame()) <...> #> env: [frame 0x36f1290] #> #> [[29]] #> <frame 10> (0) #> expr: do.call(do.call, c(readRDS("/tmp/RtmpnyPeIi/file43227a57ff01"), <...> #> env: [frame 0x36e10f0] #> #> [[30]] #> <frame 9> (0) #> expr: saveRDS(do.call(do.call, c(readRDS("/tmp/RtmpnyPeIi/file43227a57ff01"), <...> #> env: [frame 0x36e1e80] #> #> [[31]] #> <frame 8> (0) #> expr: withCallingHandlers({ <...> #> env: [frame 0x36dcc58] #> #> [[32]] #> <frame 7> (6) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x36dde10] #> #> [[33]] #> <frame 6> (5) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [frame 0x36de158] #> #> [[34]] #> <frame 5> (2) #> expr: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) #> env: [frame 0x36da6e0] #> #> [[35]] #> <frame 4> (3) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x36dac90] #> #> [[36]] #> <frame 3> (2) #> expr: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), <...> #> env: [frame 0x36dafd8] #> #> [[37]] #> <frame 2> (1) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [frame 0x36db320] #> #> [[38]] #> <frame 1> (0) #> expr: tryCatch(withCallingHandlers({ <...> #> env: [frame 0x36dba90] #> #> [[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 0x8296520] #> #> [[2]] #> <frame 39> (37) #> expr: identity(fn(1)) #> env: [local 0x8296638] #> #> [[3]] #> <frame 38> (37) #> expr: identity(identity(fn(1))) #> env: [local 0x8296750] #> #> [[4]] #> <frame 37> (36) #> expr: eval(expr, envir, enclos) #> env: [local 0x6291920] #> #> [[5]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x8296910] #> #> [[6]] #> <frame 35> (26) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x8296b40] #> #> [[7]] #> <frame 34> (26) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x82970f0] #> #> [[8]] #> <frame 33> (32) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x8297668] #> #> [[9]] #> <frame 32> (31) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x82979b0] #> #> [[10]] #> <frame 31> (30) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x8293ec8] #> #> [[11]] #> <frame 30> (29) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x8294590] #> #> [[12]] #> <frame 29> (28) #> expr: try(f, silent = TRUE) #> env: [local 0x82947c0] #> #> [[13]] #> <frame 28> (26) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x8294948] #> #> [[14]] #> <frame 27> (26) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x8294a28] #> #> [[15]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x8059aa0] #> #> [[16]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x8a4bbe0] #> #> [[17]] #> <frame 24> (23) #> expr: force(code) #> env: [frame 0x8a510e0] #> #> [[18]] #> <frame 23> (22) #> expr: withr::with_options(list(crayon.enabled = getOption("crayon.enabled", <...> #> env: [frame 0x8a544b0] #> #> [[19]] #> <frame 22> (21) #> expr: .f(code = .l[[c(1L, 1L)]], run = .l[[c(2L, 1L)]], show = .l[[c(3L, <...> #> env: [frame 0x8a57450] #> #> [[20]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x8b02658] #> #> [[21]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x7d54f30] #> #> [[22]] #> <frame 19> (18) #> expr: as_data(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x7d54590] #> #> [[23]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x800ba88] #> #> [[24]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x86cac78] #> #> [[25]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x79ae7d0] #> #> [[26]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x5078448] #> #> [[27]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x1ebac98] #> #> [[28]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x1b2ad48] #> #> [[29]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x36f02d0] #> #> [[30]] #> <frame 11> (0) #> expr: (function (what, args, quote = FALSE, envir = parent.frame()) <...> #> env: [frame 0x36f1290] #> #> [[31]] #> <frame 10> (0) #> expr: do.call(do.call, c(readRDS("/tmp/RtmpnyPeIi/file43227a57ff01"), <...> #> env: [frame 0x36e10f0] #> #> [[32]] #> <frame 9> (0) #> expr: saveRDS(do.call(do.call, c(readRDS("/tmp/RtmpnyPeIi/file43227a57ff01"), <...> #> env: [frame 0x36e1e80] #> #> [[33]] #> <frame 8> (0) #> expr: withCallingHandlers({ <...> #> env: [frame 0x36dcc58] #> #> [[34]] #> <frame 7> (6) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x36dde10] #> #> [[35]] #> <frame 6> (5) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [frame 0x36de158] #> #> [[36]] #> <frame 5> (2) #> expr: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) #> env: [frame 0x36da6e0] #> #> [[37]] #> <frame 4> (3) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x36dac90] #> #> [[38]] #> <frame 3> (2) #> expr: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), <...> #> env: [frame 0x36dafd8] #> #> [[39]] #> <frame 2> (1) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [frame 0x36db320] #> #> [[40]] #> <frame 1> (0) #> expr: tryCatch(withCallingHandlers({ <...> #> env: [frame 0x36dba90] #> #> [[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 0x6291920] #> #> [[2]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x8ada948] #> #> [[3]] #> <frame 35> (26) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x824f930] #> #> [[4]] #> <frame 34> (26) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x824f380] #> #> [[5]] #> <frame 33> (32) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x824ee08] #> #> [[6]] #> <frame 32> (31) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x824eac0] #> #> [[7]] #> <frame 31> (30) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x824e708] #> #> [[8]] #> <frame 30> (29) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x824e040] #> #> [[9]] #> <frame 29> (28) #> expr: try(f, silent = TRUE) #> env: [local 0x824de10] #> #> [[10]] #> <frame 28> (26) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x824dc18] #> #> [[11]] #> <frame 27> (26) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x85a9d88] #> #> [[12]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x835f268] #> #> [[13]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x8a4bbe0] #> #> [[14]] #> <frame 24> (23) #> expr: force(code) #> env: [frame 0x8a510e0] #> #> [[15]] #> <frame 23> (22) #> expr: withr::with_options(list(crayon.enabled = getOption("crayon.enabled", <...> #> env: [frame 0x8a544b0] #> #> [[16]] #> <frame 22> (21) #> expr: .f(code = .l[[c(1L, 1L)]], run = .l[[c(2L, 1L)]], show = .l[[c(3L, <...> #> env: [frame 0x8a57450] #> #> [[17]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x8b02658] #> #> [[18]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x7d54f30] #> #> [[19]] #> <frame 19> (18) #> expr: as_data(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x7d54590] #> #> [[20]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x800ba88] #> #> [[21]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x86cac78] #> #> [[22]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x79ae7d0] #> #> [[23]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x5078448] #> #> [[24]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x1ebac98] #> #> [[25]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x1b2ad48] #> #> [[26]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x36f02d0] #> #> [[27]] #> <frame 11> (0) #> expr: (function (what, args, quote = FALSE, envir = parent.frame()) <...> #> env: [frame 0x36f1290] #> #> [[28]] #> <frame 10> (0) #> expr: do.call(do.call, c(readRDS("/tmp/RtmpnyPeIi/file43227a57ff01"), <...> #> env: [frame 0x36e10f0] #> #> [[29]] #> <frame 9> (0) #> expr: saveRDS(do.call(do.call, c(readRDS("/tmp/RtmpnyPeIi/file43227a57ff01"), <...> #> env: [frame 0x36e1e80] #> #> [[30]] #> <frame 8> (0) #> expr: withCallingHandlers({ <...> #> env: [frame 0x36dcc58] #> #> [[31]] #> <frame 7> (6) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x36dde10] #> #> [[32]] #> <frame 6> (5) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [frame 0x36de158] #> #> [[33]] #> <frame 5> (2) #> expr: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) #> env: [frame 0x36da6e0] #> #> [[34]] #> <frame 4> (3) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x36dac90] #> #> [[35]] #> <frame 3> (2) #> expr: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), <...> #> env: [frame 0x36dafd8] #> #> [[36]] #> <frame 2> (1) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [frame 0x36db320] #> #> [[37]] #> <frame 1> (0) #> expr: tryCatch(withCallingHandlers({ <...> #> env: [frame 0x36dba90] #> #> [[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 0x7d3f080] #> #> [[2]] #> <frame 37> (36) #> expr: eval(expr, envir, enclos) #> env: [local 0x6291920] #> #> [[3]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x7d3ee88] #> #> [[4]] #> <frame 35> (26) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x7d3ec58] #> #> [[5]] #> <frame 34> (26) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x7d3e6a8] #> #> [[6]] #> <frame 33> (32) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x7d3e130] #> #> [[7]] #> <frame 32> (31) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x7d3dd78] #> #> [[8]] #> <frame 31> (30) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x7d3d918] #> #> [[9]] #> <frame 30> (29) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x7d48fd8] #> #> [[10]] #> <frame 29> (28) #> expr: try(f, silent = TRUE) #> env: [local 0x7d48d00] #> #> [[11]] #> <frame 28> (26) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x7d48b78] #> #> [[12]] #> <frame 27> (26) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x7d48a98] #> #> [[13]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x7dae090] #> #> [[14]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x8a4bbe0] #> #> [[15]] #> <frame 24> (23) #> expr: force(code) #> env: [frame 0x8a510e0] #> #> [[16]] #> <frame 23> (22) #> expr: withr::with_options(list(crayon.enabled = getOption("crayon.enabled", <...> #> env: [frame 0x8a544b0] #> #> [[17]] #> <frame 22> (21) #> expr: .f(code = .l[[c(1L, 1L)]], run = .l[[c(2L, 1L)]], show = .l[[c(3L, <...> #> env: [frame 0x8a57450] #> #> [[18]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x8b02658] #> #> [[19]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x7d54f30] #> #> [[20]] #> <frame 19> (18) #> expr: as_data(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x7d54590] #> #> [[21]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x800ba88] #> #> [[22]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x86cac78] #> #> [[23]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x79ae7d0] #> #> [[24]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x5078448] #> #> [[25]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x1ebac98] #> #> [[26]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x1b2ad48] #> #> [[27]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x36f02d0] #> #> [[28]] #> <frame 11> (0) #> expr: (function (what, args, quote = FALSE, envir = parent.frame()) <...> #> env: [frame 0x36f1290] #> #> [[29]] #> <frame 10> (0) #> expr: do.call(do.call, c(readRDS("/tmp/RtmpnyPeIi/file43227a57ff01"), <...> #> env: [frame 0x36e10f0] #> #> [[30]] #> <frame 9> (0) #> expr: saveRDS(do.call(do.call, c(readRDS("/tmp/RtmpnyPeIi/file43227a57ff01"), <...> #> env: [frame 0x36e1e80] #> #> [[31]] #> <frame 8> (0) #> expr: withCallingHandlers({ <...> #> env: [frame 0x36dcc58] #> #> [[32]] #> <frame 7> (6) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x36dde10] #> #> [[33]] #> <frame 6> (5) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [frame 0x36de158] #> #> [[34]] #> <frame 5> (2) #> expr: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) #> env: [frame 0x36da6e0] #> #> [[35]] #> <frame 4> (3) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x36dac90] #> #> [[36]] #> <frame 3> (2) #> expr: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), <...> #> env: [frame 0x36dafd8] #> #> [[37]] #> <frame 2> (1) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [frame 0x36db320] #> #> [[38]] #> <frame 1> (0) #> expr: tryCatch(withCallingHandlers({ <...> #> env: [frame 0x36dba90] #> #> [[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 0x6291920] #> #> [[2]] #> <frame 36> (26) #> expr: eval(expr, envir, enclos) #> env: [local 0x5e1d720] #> #> [[3]] #> <frame 35> (26) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x5e1d4f0] #> #> [[4]] #> <frame 34> (26) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x5e1cf08] #> #> [[5]] #> <frame 33> (32) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x5e22638] #> #> [[6]] #> <frame 32> (31) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x5e222b8] #> #> [[7]] #> <frame 31> (30) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x5e21f70] #> #> [[8]] #> <frame 30> (29) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x5e21838] #> #> [[9]] #> <frame 29> (28) #> expr: try(f, silent = TRUE) #> env: [local 0x5e21608] #> #> [[10]] #> <frame 28> (26) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x5e21480] #> #> [[11]] #> <frame 27> (26) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x5e21288] #> #> [[12]] #> <frame 26> (25) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x5e6da78] #> #> [[13]] #> <frame 25> (22) #> expr: evaluate::evaluate(code, env, new_device = TRUE) #> env: [frame 0x8a4bbe0] #> #> [[14]] #> <frame 24> (23) #> expr: force(code) #> env: [frame 0x8a510e0] #> #> [[15]] #> <frame 23> (22) #> expr: withr::with_options(list(crayon.enabled = getOption("crayon.enabled", <...> #> env: [frame 0x8a544b0] #> #> [[16]] #> <frame 22> (21) #> expr: .f(code = .l[[c(1L, 1L)]], run = .l[[c(2L, 1L)]], show = .l[[c(3L, <...> #> env: [frame 0x8a57450] #> #> [[17]] #> <frame 21> (20) #> expr: purrr::pmap_chr(list(code = code, run = run, show = show), format_example_chunk, <...> #> env: [frame 0x8b02658] #> #> [[18]] #> <frame 20> (18) #> expr: as_data.tag_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x7d54f30] #> #> [[19]] #> <frame 19> (18) #> expr: as_data(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x7d54590] #> #> [[20]] #> <frame 18> (17) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x800ba88] #> #> [[21]] #> <frame 17> (16) #> expr: .f(.x[[i]], ...) #> env: [frame 0x86cac78] #> #> [[22]] #> <frame 16> (15) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x79ae7d0] #> #> [[23]] #> <frame 15> (14) #> expr: build_reference(pkg, lazy = lazy, document = document, examples = examples, <...> #> env: [frame 0x5078448] #> #> [[24]] #> <frame 14> (13) #> expr: build_site_local(pkg = pkg, examples = examples, document = document, <...> #> env: [frame 0x1ebac98] #> #> [[25]] #> <frame 13> (12) #> expr: pkgdown::build_site(...) #> env: [frame 0x1b2ad48] #> #> [[26]] #> <frame 12> (0) #> expr: (function (..., crayon_enabled, crayon_colors, pkgdown_internet) <...> #> env: [frame 0x36f02d0] #> #> [[27]] #> <frame 11> (0) #> expr: (function (what, args, quote = FALSE, envir = parent.frame()) <...> #> env: [frame 0x36f1290] #> #> [[28]] #> <frame 10> (0) #> expr: do.call(do.call, c(readRDS("/tmp/RtmpnyPeIi/file43227a57ff01"), <...> #> env: [frame 0x36e10f0] #> #> [[29]] #> <frame 9> (0) #> expr: saveRDS(do.call(do.call, c(readRDS("/tmp/RtmpnyPeIi/file43227a57ff01"), <...> #> env: [frame 0x36e1e80] #> #> [[30]] #> <frame 8> (0) #> expr: withCallingHandlers({ <...> #> env: [frame 0x36dcc58] #> #> [[31]] #> <frame 7> (6) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x36dde10] #> #> [[32]] #> <frame 6> (5) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [frame 0x36de158] #> #> [[33]] #> <frame 5> (2) #> expr: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) #> env: [frame 0x36da6e0] #> #> [[34]] #> <frame 4> (3) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [frame 0x36dac90] #> #> [[35]] #> <frame 3> (2) #> expr: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), <...> #> env: [frame 0x36dafd8] #> #> [[36]] #> <frame 2> (1) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [frame 0x36db320] #> #> [[37]] #> <frame 1> (0) #> expr: tryCatch(withCallingHandlers({ <...> #> env: [frame 0x36dba90] #> #> [[38]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "ctxt_stack" "stack"