Are you saying that at some point functions like lang_head and friends , or equivalent, will appear as functions with a call_ prefix or in some other form?
Yes, using lang
instead of call
was meant to be consistent with the way R labels object types (see typeof(quote(foo()))
) because we didn't want to create yet another nomenclature (cf historical mode vs type). However Hadley found it much easier to talk about calls rather than language object while writing the new edition of his book. As "call" is much more intuitive we are probably going to backtrack on this.
About lang_head()
and lang_args()
I had completely forgotten about these functions :). It's interesting that you find them useful to get your head around tidy eval and R expressions!
Note that you can use base subsetting to manipulate calls:
x <- quo(foo(bar, baz))
x
#> <quosure>
#> ~foo(bar, baz)
x[[2]]
#> foo(bar, baz)
x[[2]][[3]] <- quote(BAZ)
x
#> <quosure>
#> ~foo(bar, BAZ)
x[[2]][c(2, 3)] <- list(quote(qux), quote(quux))
#> <quosure>
#> ~foo(qux, quux)
You can also use this to insert quosures. However for cases where it makes sense we are advising a quasiquotation approach to manipulating calls. More on this in the next edition of adv-r!