rlang icon indicating copy to clipboard operation
rlang copied to clipboard

Transition quosures away from formulas

Open lionel- opened this issue 3 years ago • 0 comments

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(), or eval_bare(). We no longer need a "quosure mask" when data is not supplied (a mask with a single ~ binding). Then return(), sys.frame(), etc. will work correctly.
  • We have abstracted quosures internals with quo_get_expr() and quo_get_env() so the transition should not be too harsh.

lionel- avatar Mar 30 '21 13:03 lionel-