-
Notifications
You must be signed in to change notification settings - Fork 21
Consider evocative aliases #5
Comments
That's similar to the naming scheme we had in earlier versions of rlang. Some thoughts:
|
|
FWIW Also possible that my mental model is just totally wrong, since you blew my mind yesterday with the |
delay_action(arg) # enquo()
delay_variable(arg) # ensym()
as_name(delay_variable(arg))
as_label(delay_action(arg)) |
action <- delay_action(arg)
action <- expand(mean(!!action, na.rm = TRUE)) |
Why do you prefer One reason might be to pick an antonym for |
I was thinking about
I think "delaying" instead of "quoting" or "capturing" is more suggestive of why we need to quote. If users understands why, they are more likely to remember what to do the next time around. The next step is to understand how to change blueprints. It's easy to change results, but to change a blueprint we need Finally, what are blueprints made of: variables (symbols) and actions (function calls). Though I'm not entirely happy with |
I think if we decide to change the names, we need to design some sort of experiment so that we can validate that the new names are actually easier for people to understand. I know that @gvwilson would be very happy to help out with this sort of experiment. |
Funnily enough, I was just discussing this with Andy Stefik... |
Going with the defusing / booby trap analogy: expr() -> defuse()
enquo() -> arg_defuse()
dfs <- list(mtcars[1:2, 1:4], mtcars[3:4, 1:4])
defuse(rbind(!!!dfs))
#> rbind(<data.frame>, <data.frame>)
blast(rbind(!!!dfs))
#> mpg cyl disp hp
#> Mazda RX4 21.0 6 160 110
#> Mazda RX4 Wag 21.0 6 160 110
#> Datsun 710 22.8 4 108 93
#> Hornet 4 Drive 21.4 6 258 110 |
@jimhester suggested:
tidy_capture()
andtidy_capture_dots()
forenquo()
andenquos()
tidy_build()
forexpr()
tidy_eval()
foreval_tidy()
But we should consider all functions used in the book before providing any new aliases
The text was updated successfully, but these errors were encountered: