Closed jonthegeek closed 5 years ago
But it doesn't actually do anything?
Don't you need it when there's tidyeval on the LHS of a parameter assignment? When I do that, cran checks complain about := until/unless I at least import.
This is still the method we have in the tidyeval cookbook, and programming with dplyr:
library(rlang)
name <- "the real name"
c(name = NA)
rlang::qq_show(c(!!name := NA))
rlang::qq_show(c(!!name = NA))
#> Error: <text>:6:25: unexpected '='
#> 5: rlang::qq_show(c(!!name := NA))
#> 6: rlang::qq_show(c(!!name =
#> ^
Created on 2019-01-23 by the reprex package (v0.2.1.9000)
Yeah, it's just a syntactic operation so the :=
function is never actually called (IIRC). But if R CMD check has a problem with it, we should include. @jonthegeek do you want to do a PR?
Sure, I can probably knock this out tonight.
Ironically I am getting this exact NOTE in a usethis branch, due to my use of :=
.
I think we need to think separately about the need for @importFrom rlang :=
vs. the need to re-export it. cc @lionel-
Reexporting it in our packages will give a useful error message when :=
is used in a wrong context, so that seems helpful.
:= (the tidyeval assignment operator, which I pronounce "digested is") is often as useful for tidyeval as the functions exported by the file generated via usethis::use_tidyeval(). It would be helpful if it were also re-exported.