We have already used environments in a couple of examples to evaluate expressions in a different context than where we usually evaluate them, which is known as non-standard evaluation . Many domain-specific languages that we could implement in R will need some variety of non-standard evaluation, but getting the evaluation to occur in the right context can be problematic. The rules for how expressions are evaluated are simple, while evaluation contexts, which are chains of environments, can be complicated.
We will use the rlang package.