check_dots_empty: Check that dots are unused

Description Usage Arguments Examples

Description

Sometimes you just want to use ... to force your users to fully name the details arguments. This function warns if ... is not empty.

Usage

1
check_dots_empty(env = parent.frame(), action = abort)

Arguments

env

Environment in which to look for ....

action

The action to take when the dots have not been used. One of rlang::abort(), rlang::warn(), rlang::inform() or rlang::signal().

Examples

1
2
3
4
5
6
7
f <- function(x, ..., foofy = 8) {
  check_dots_empty()
  x + foofy
}

try(f(1, foof = 4))
f(1, foofy = 4)

r-lib/ellipsis documentation built on Sept. 23, 2019, 5:42 a.m.