problem is that tags don't support dots and we decided they shouldn't, and if we give a list input it will consider it as an environment.
Several workarounds are possible :
an additional argument .multi = FALSE would, if TRUE, make the function consider as environments the objects contained in the list, that would be the most standard way I guess. so we'd have using(list(var1, var2), .multi = TRUE)$foo(...)
a formula : using(~var1 + var2)$foo(...), a bit weird and hard to metaprogram (or not that much, using reformulate(), but compact.
don't do anything, just stack current using() : using(var1)$using(var2)$foo(...), but quite verbose and won't work with [.tags_using
just have several slots so using is a function of .envir, .envir2, .envir3 : that's clunky but in practice would we really superpose more than 3 envirs ? and the syntax is as if we were using dots : using(var1, var2)$foo(...)
a .fallback argument that is a list of environments (in the wide sense), so we'll write using(var1, list(var2))$foo(...) OR using(,list(var1, var2)$foo(...), it's a bit like first proposal, maybe slightly harder to understand but this way the . can still refer to .envir (var1 in the first case).
use expression to hack our way around it : using(expression(var1, var2))$foo(...), convenient and easy but weird.
problem is that tags don't support dots and we decided they shouldn't, and if we give a list input it will consider it as an environment.
Several workarounds are possible :
.multi = FALSE
would, if TRUE, make the function consider as environments the objects contained in the list, that would be the most standard way I guess. so we'd haveusing(list(var1, var2), .multi = TRUE)$foo(...)
using(~var1 + var2)$foo(...)
, a bit weird and hard to metaprogram (or not that much, usingreformulate()
, but compact.using(var1)$using(var2)$foo(...)
, but quite verbose and won't work with[.tags_using
.envir
,.envir2
,.envir3
: that's clunky but in practice would we really superpose more than 3 envirs ? and the syntax is as if we were using dots : using(var1, var2)$foo(...).fallback
argument that is a list of environments (in the wide sense), so we'll writeusing(var1, list(var2))$foo(...)
ORusing(,list(var1, var2)$foo(...)
, it's a bit like first proposal, maybe slightly harder to understand but this way the.
can still refer to.envir
(var1
in the first case).expression
to hack our way around it :using(expression(var1, var2))$foo(...)
, convenient and easy but weird.