# NOT RUN {
parent <- child_env(NULL, foo = "foo")
env <- child_env(parent, bar = "bar")
# This throws an error because `foo` is not directly defined in env:
# env_get(env, "foo")
# However `foo` can be fetched in the parent environment:
env_get(env, "foo", inherit = TRUE)
# }
Run the code above in your browser using DataLab