This pairlist constructor supports tidy dots features like !!!. Use it to manually create argument lists for calls or parameter lists for functions.

pairlist2(...)

Arguments

...

Arguments stored in the pairlist. Empty arguments are preserved.

Examples

# Unlike `exprs()`, `pairlist2()` evaluates its arguments. new_function(pairlist2(x = 1, y = 3 * 6), quote(x * y))
#> function (x = 1, y = 18) #> x * y #> <environment: 0x83c07a8>
new_function(exprs(x = 1, y = 3 * 6), quote(x * y))
#> function (x = 1, y = 3 * 6) #> x * y #> <environment: 0x83c07a8>
# It preserves missing arguments, which is useful for creating # parameters without defaults: new_function(pairlist2(x = , y = 3 * 6), quote(x * y))
#> function (x, y = 18) #> x * y #> <environment: 0x83c07a8>