Skip to content
Prev 6755 / 63424 Next

Mishandling missing "..." (PR#1247)

On Mon, 7 Jan 2002 brahm@alum.mit.edu wrote:

            
This is interesting.  Another workaround is
function(x, ...) {x[...] <- 0; x}
[1] 0

and the problem goes down to eval.c:evalListKeepMissing, which says
	/* If we have a ... symbol, we look to see what it is bound to.
	 * If its binding is Null (i.e. zero length)
	 *	we just ignore it and return the cdr with all its
               expressions evaluated;

The difference between  myfun(3) and myfun(3,) is that in the former case
there are no ... arguments, in the latter there is a ... argument but it's
missing.

In one way this would be fairly easy to fix by writing yet another variant
of evalList that replaced an empty ... with R_MissingArg, but I'm scared.


	-thomas

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._