Hi,

In some cases the number of arguments passed as ... must be determined inside a function, without evaluating the arguments themselves. I use the following construct:

dotlength <- function(...) length(substitute(expression(...))) - 1L

# Usage (returns 3):
dotlength(1, 4, something = undefined)

How can I define a method for length() which could be called directly on `...`? Or is it an intention to extend the base length() function to accept ellipses?


Regards,
Denes

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to