search for: some_complex_condition

Displaying 2 results from an estimated 2 matches for "some_complex_condition".

2019 Mar 23
4
topenv of emptyenv
...wn top-level environment (I thought). Unfortunately the documentation on environments is relatively sparse, and the R Internals document doesn?t mention top-level environments. Concretely, I encountered this in the following code, which signals an error if `env` is the empty environment: while (! some_complex_condition(env) && ! identical(env, toplevel(env))) { env = parent.env(env) } Of course there?s a trivial workaround (add an identity check for `emptyenv()` in the while loop condition) but it got me wondering if there?s a rationale for this result or if it?s ?accidental?/arbitrary: the C `topenv...
2019 Mar 28
0
topenv of emptyenv
...; Unfortunately the documentation on environments is relatively sparse, > and the R Internals document doesn?t mention top-level environments. > Concretely, I encountered this in the following code, which signals an > error if `env` is the empty environment: > while (! some_complex_condition(env) && ! identical(env, toplevel(env))) { > env = parent.env(env) > } I guess the above 'toplevel(env)' should be replaced by 'topenv(env)' ? > Of course there?s a trivial workaround (add an identity check for > `emptyenv()` in the while l...