methods: representation gives "unused arguments" on failure
(PR#1796)
John Chambers
jmc@research.bell-labs.com
Tue, 16 Jul 2002 16:59:22 -0400
markus.jantti@iki.fi wrote:
>
> Full_Name: Markus Jantti
> Version: 1.5.1
> OS: GNU/Linux Unstable (Sid)
> Submission from: (NULL) (193.166.59.44)
>
> I was trying to get the package yags 3.20 by Vince Carey
> <stvjc@channing.harvard.edu>
> to run, but - after successfull installation -- loading the library failed with
> the
> message
>
> > library(yags)
> Error in stop(paste("Duplicated slot names: ", paste(slots[duplicated(slo
> :
> unused argument(s) (sep ...)
> Error in eval(expr, envir, enclos) : could not set Class
>
> R CMD check also fails (first for having a malformed Depends line
> in DESCRIPTION, then on running the examples with the above error message.
>
> > R.version
> _
> platform i386-pc-linux-gnu
> arch i386
> os linux-gnu
> system i386, linux-gnu
> status
> major 1
> minor 5.1
> year 2002
> month 06
> day 17
> language R
> Those were the facts. R FAQ: Bugs warns against trying to provide an
> explanation for what happens. However, I was unable to resist trying
> to figure out what was wrong.
>
> There was a duplicated slot name in the yags source code the triggered
> this "stop" function, but apparently the 'sep = ""' argument has slipped
> out of the parentheses following the 'paste' function and is now an argument
> to the 'stop' function instead, which generates the 'unused argument(s)'
> error. This occurs in the function 'representation' in the file
> SClasses.R in the methods directory of the R source. The same typo
> occurs in the same function a few lines above it. The following diff
> indicates at which lines these 'stop' functions occur:
>
> tykki:~/R-1.5.1/src/library/methods/R# diff SClasses.R.old SClasses.R
> 33c33
> < stop(paste("Duplicate class names among superclasses:",
> paste(includes[duplicated(includes)], collapse = ", ")), sep="")
> ---
> > stop(paste("Duplicate class names among superclasses:",
> paste(includes[duplicated(includes)], collapse = ", "), sep=""))
> 36c36
> < stop(paste("Duplicated slot names: ", paste(slots[duplicated(slots)],
> collapse="")), sep="")
> ---
> > stop(paste("Duplicated slot names: ", paste(slots[duplicated(slots)],
> collapse=""), sep=""))
> ---
> I am no sure if the 'sep = ""' argument is intended for the first or the
> second of the 'paste' functions.
The outer call.
Thanks.
It might be nice to have stop() take multiple arguments in the same
style as warning() to save typographical errors for those of us with
parenthesis-dislexia. Looks like the same one-line addition,
if(nargs() == 0) message <- NULL else message <- paste(...,
sep="")
would work in stop().
>
> I have separately notified the author of yags about the problem there.
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
--
John M. Chambers jmc@bell-labs.com
Bell Labs, Lucent Technologies office: (908)582-2681
700 Mountain Avenue, Room 2C-282 fax: (908)582-3340
Murray Hill, NJ 07974 web: http://www.cs.bell-labs.com/~jmc
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._