Get breadcrumbs and output a message.

get_breadcrumbs(void, verbose = TRUE)

Arguments

void

Any object. Not used.

verbose

A flag. Should a message be outputted?

Value

An ordered character vector containing the names of the nested modules.

Details

Breadcrumbs allow to keep track of locations within modules. This is particularily useful to circumvent an error occurring in a chain of nested dependent modules, for instance. See reactivate_breadcrumbs.

See also

reactivate_breadcrumbs, define, make, and reset.

Examples

reset() define("foo", NULL, function() function() get_breadcrumbs())
#> [2017-06-21T21:58:20 UTC] Defining 'foo' ... OK
define("bar", list(foo = "foo"), function(foo) function() foo())
#> [2017-06-21T21:58:20 UTC] Defining 'bar' ... OK
define("foobar", list(bar = "bar"), function(bar) (bar()))
#> [2017-06-21T21:58:20 UTC] Defining 'foobar' ... OK
#> [2017-06-21T21:58:20 UTC] Making 'foobar' ... #> [2017-06-21T21:58:20 UTC] * Visiting and defining dependencies ... #> [2017-06-21T21:58:20 UTC] * Constructing dependency graph ... OK #> [2017-06-21T21:58:20 UTC] * Sorting 2 dependencies with 2 relations ... on 2 layers, OK #> [2017-06-21T21:58:20 UTC] * Evaluating new and outdated dependencies ... #> [2017-06-21T21:58:20 UTC] ** Evaluating #1/2 (layer #1/2): 'foo' ... #> [2017-06-21T21:58:20 UTC] ** Evaluating #2/2 (layer #2/2): 'bar' ...
#> modulr breadcrumbs: '__main__' > 'foobar' > 'bar' > 'foo'
#> [2017-06-21T21:58:20 UTC] DONE ('foobar' in 0.032 secs)
#> [1] "__main__" "foobar" "bar" "foo"
#> [2017-06-21T21:58:20 UTC] Resetting modulr state ... OK
#> (function () #> { #> modulr::get_breadcrumbs("installed") #> eval(parse(text = deparse(handler)), envir = parent.frame()) #> if (!interactive()) #> stop(call. = FALSE) #> })()
define("foo", NULL, function() function() stop("error in 'foo'"))
#> [2017-06-21T21:58:20 UTC] Defining 'foo' ... OK
define("bar", list(foo = "foo"), function(foo) function() foo())
#> [2017-06-21T21:58:20 UTC] Defining 'bar' ... OK
define("foobar", list(bar = "bar"), function(bar) bar())
#> [2017-06-21T21:58:20 UTC] Defining 'foobar' ... OK
## Not run: make()