get_from_caller_env_recursive: Low-level accessors for getting properties

Description Usage Arguments Value Functions Examples

View source: R/checks.R

Description

get_from_caller_env_recursive(nm) gets the object called nm from the call stack. get_property is a friendlier api for specifically getting properties out of CanonicalForm environments.

Usage

1
2
3
4
5
get_from_caller_env_recursive(nm, i = 1, recursion_limit = 100)

get_property(nm, cf = NULL)

run_in_cf_env(cf, f, ...)

Arguments

nm

the name of the object to get

i

the number of levels up to climb in the call stack. This should usually not be set manually, but is incremented recursively by the function.

recursion_limit

a limit that probably shouldn't be used, except for testing

cf

a CanonicalForm object

f

function to execute

...

arguments to pass to f

Value

the property to get

Functions

Examples

1
2
3
4
5
6
7
8
9
e1 <- new.env()
e1$a <- "a"
do.call(CanonicalForms:::get_from_caller_env_recursive, list(nm = "a"), envir = e1)

cf <- extract_canonical_form(cars)
get_property(".col_names", cf)
f <- function() get_property(".col_names")
do.call(f, list(), envir = CanonicalForms:::get_check_env(cf))
CanonicalForms:::run_in_cf_env(cf, get_property, nm = ".col_names")

colin-fraser/CanonicalForms documentation built on Jan. 8, 2022, 8:42 a.m.