Examples for 'rlang::pairlist2'


Collect dynamic dots in a pairlist

Aliases: pairlist2

Keywords:

### ** 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: 0x55ccfe2ef910>
new_function(exprs(x = 1, y = 3 * 6), quote(x * y))
function (x = 1, y = 3 * 6) 
x * y
<environment: 0x55ccfe2ef910>
# 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: 0x55ccfe2ef910>

[Package rlang version 1.1.4 Index]