R-alpha: multiple arguments with the same name

Luke Tierney (luke@stat.umn.edu)
Wed, 19 Jun 1996 03:36:55 -0500 (CDT)


From: Luke Tierney <luke@stat.umn.edu>
Message-Id: <9606190836.AA25773@nokomis.stat.umn.edu>
Subject: R-alpha: multiple arguments with the same name
To: r-testers@stat.math.ethz.ch
Date: Wed, 19 Jun 1996 03:36:55 -0500 (CDT)

R (and S) allow a function to have multiple arguments with the same
name (allow in the sense of not signaling an error). For example,

> f<-function(x,x) x
> f(1,2)
[1] 1

Multiple ... arguments are also allowed, and the boxplot function is defined as

boxplot := function(x, ..., range=1.5, width=NULL, varwidth=FALSE,
	notch=FALSE, names, plot=TRUE, col=par("fg"), fill=NULL, log="", ...)
{
	.......
}

I don't understand what this is supposed to mean.

Is this a feature or a bug? Would it be better to signal an error if a
function with multiple identical arguments is created?

luke

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- To (un)subscribe, send
subscribe	or	unsubscribe
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-