Most important effect to support: evaluation in a nested scope (e.g. test_that()). Definitions in a nested scope shouldn't escape.
Other effects to support soon:
- Attach (
library(), require())
- Source
- Assign (S7's
:=, magrittr's %<>%, base::delayedAssign(), etc)
- Quote (
quote(), bquote()), including unquoted holes with e.g. .(arg) or !!arg
Effects for later:
- Eval (to be done a bit later because this requires data flow to be useful)
- ExprCapture (
substitute())
- EnvCapture (
new.env(), parent.frame(), environment())
Not straightforward because these effects can interact with each other, e.g. a Source may hide effects, a nested NSE scope may cause an effect to be masked, or on the contrary may prevent an effect to be masked, etc. Main idea: resolve effect linearly. Any effect in a lazy scope that contradicts a linear effect is an ambiguous program that should be linted.
All these effects should be expressible with either:
-
Local declarations with declare(), which requires a mini language spec for describing these effects
-
Custom Rust handlers vendored in Oak. Many functions have complex effects depending on arguments and trying to express these with a DSL is a lost cause. We'll provide support for argument matching, static resolution of values, etc.
Most important effect to support: evaluation in a nested scope (e.g.
test_that()). Definitions in a nested scope shouldn't escape.Other effects to support soon:
library(),require()):=, magrittr's%<>%,base::delayedAssign(), etc)quote(),bquote()), including unquoted holes with e.g..(arg)or!!argEffects for later:
substitute())new.env(),parent.frame(),environment())Not straightforward because these effects can interact with each other, e.g. a Source may hide effects, a nested NSE scope may cause an effect to be masked, or on the contrary may prevent an effect to be masked, etc. Main idea: resolve effect linearly. Any effect in a lazy scope that contradicts a linear effect is an ambiguous program that should be linted.
All these effects should be expressible with either:
Local declarations with
declare(), which requires a mini language spec for describing these effectsCustom Rust handlers vendored in Oak. Many functions have complex effects depending on arguments and trying to express these with a DSL is a lost cause. We'll provide support for argument matching, static resolution of values, etc.