Closed lionel- closed 7 years ago
Also recode()
currently uses ...
The other big question is whether we should use call-splicing (where we inspect the call) or value-splicing (where we inspect the value). The advantage of call-splicing is that it's the same style as tidyeval; the advantage of value-splicing is that it's simpler.
Having a uniform interface is appealing. But I think we'd want to keep a clean separation between SE and NSE functions. For instance that would allow us to signal SE arguments to R and give more guarantees to the compiler. This would enable it to compile these arguments in the future. Though maybe we don't care about that?
By the way, do we want to support :=
? It's self-quoting so no NSE, and would make it easy to use a variable as name.
By the way, do we want to support :=? It's self-quoting so no NSE, and would make it easy to use a variable as name.
But then we're relying on !!
to unquote the name. So probably we'd only want to do that if we used call-splicing.
One issue with call-splicing to keep in mind, when we are unquoting values, is that it will lead to noisy stacktraces.
I think if we're clear about the distinction between call-splicing and value-splicing we should be ok.
One question is where spliced()
(or maybe splice_in()
) should live. In rlang and re-export in dplyr? (And every other package that uses it)
yes I would think in rlang. We'd support splicing in rlang's primitives too, like in with_handlers()
.
Using
rlang::splice()
.One issue is whether we allow bare list splicing or if we require the use of a modifier/adverb for signalling splicing. Bare-list splicing would apply most of the time, since most functions expect either atomic vectors or S3 objects in
...
. It is less verbose:On the other hand, some functions also expect lists in
...
. A replacement forstructure()
would be an example. In this case an adverb likespliced()
is necessary:We'd need a standardised way of documenting those semantics in roxygen. But even then, would it be confusing to have these two kinds of splicing in the tidyverse?