What is "..." when it's empty? -- differences to S

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
26 Jun 1999 16:53:02 +0200


Martin Maechler <maechler@stat.math.ethz.ch> writes:

> i)       (function(x, ...) length(...))(1)
> 
> gives 0 in S (plus 3.4) and an error in R.
> It also gives an error in Splus 5.0r3.
> So we could well remain as we are... however
> 
> ii)	(function(x, ...) length(...))(1,2)
> 
> gives 1  in all dialects of S that I have available.
> So by my `continuation logic', I'd argue that  "i)" above should give 0
> (and R and S-plus 5.0r3 behave inconsistently.
> 
> Do we yet have any documentation on "..." ??
> 
> In both Splus 3.4 and 5.0r3,
>    (function(x, ...) mode(...))(1)	returns "missing"
> whereas R gives an interesting error:
>     R> trace(mode)
>     R> (function(x, ...) mode(...))(1)
>     trace: mode(...)
>     Error: Argument "x" is missing, with no default
> 
> ---
> What is desired for R?

I don't have S-plus 5.0r3 around, but the two others are consistent
with the result of length(), resp. mode() (with no arguments), both of
which have minor R/S incompatiblities. I see nothing wrong with "...",
but we might consider modifying length() and mode(), both of which
look like one-line if(is.missing(.... changes.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._