The functions do
and do_
construct and invoke a function call.
In combination with dots and quotation objects they allow you
to control the scope of the function call and each of its arguments
independently.
do(...)do_(...)
All arguments are concatenated using c.dots()
. The
first element of the resulting list is taken as a function to
call, the rest as its arguments.
The return value of the call.
For do_
all arguments should be quotation
or dots
objects, or
convertible to such using as.quo()
. They will be concatenated
together by c.dots to form the call list (a dots
object).
For do
the first argument is quoted literally, but the
rest of the arguments are evaluated the same way as do_.
The first element of the call list represents the function, and it should evaluate to a function object. The rest of the call list is used as that function's arguments.
When a quotation is used as the first element, the call is evaluated
from the environment given in that quotation. This means that calls
to caller()
(or parent.frame()
) from within that function
should return that environment.
do
is intended to be a replacement for base function do.call.
get_call do.call match.call