Skip to content
Prev 55179 / 63424 Next

length of `...`

The one difference I see, is the necessity to pass the dots to the function
dotlength :

dotlength <- function(...) nargs()

myfun <- function(..., someArg = 1){
  n1 <- ...length()
  n2 <- dotlength()
  n3 <- dotlength(...)
  return(c(n1, n2, n3))
}

myfun(stop("A"), stop("B"), someArg = stop("c"))

I don't really see immediately how one can replace the C definition with
Hadley's solution without changing how the function has to be used.
Personally, I have no preference over the use, but changing it now would
break code dependent upon ...length() imho. Unless I'm overlooking
something of course.

Cheers
Joris


On Fri, May 4, 2018 at 3:02 PM, Martin Maechler <maechler at stat.math.ethz.ch>
wrote: