vetr icon indicating copy to clipboard operation
vetr copied to clipboard

Substituting Arg When Combining `.` and Diff Arg Name

Open brodieG opened this issue 7 years ago • 0 comments

fun2 <- function(x, y)
  validate_args(
    x=integer(),
    y=character() && length(x) == length(.)
  )
fun2(1:3, letters[1:4])
## Error in fun2(x = 1:3, y = letters[1:4]) : 
##  For argument `y`, `length(x) == length(letters[1:4])` is not TRUE (FALSE)

Would be nice if x was also subbed so the above is consistent? As it is this is almost worse than:

length(x) == length(y)

brodieG avatar Apr 22 '17 14:04 brodieG