rlang
rlang copied to clipboard
Transition quosures away from formulas
We could replace formulas by rlang::q(expr, <env>)
calls (or rlang::q(expr)
if we store the env in attributes like with formulas, but I like @brodieG's idea of leaving it apparent in the call, see https://www.brodieg.com/2020/08/11/quosures/).
- With R 4.1 and primitive
::
we no longer have a significant overhead to using::
. IIRC this one of the reasons we went for formulas at the time. - This would fix obscure corner cases #1124
- Quosures can then be evaluated with
eval()
,Rf_eval()
, oreval_bare()
. We no longer need a "quosure mask" when data is not supplied (a mask with a single~
binding). Thenreturn()
,sys.frame()
, etc. will work correctly. - We have abstracted quosures internals with
quo_get_expr()
andquo_get_env()
so the transition should not be too harsh.