signature match in setMethod (PR#1592)

tkeitt@ms.cc.sunysb.edu tkeitt@ms.cc.sunysb.edu
Wed, 22 May 2002 23:04:54 +0200 (MET DST)


Full_Name: Tim Keitt
Version: 1.5
OS: Linux
Submission from: (NULL) (128.227.201.237)


The function "setMethod" makes the following call to "insertMethod":

allMethods <- insertMethod(allMethods, signature, fnames[1:length(signature)], 
        asMethodDefinition(definition, signature))

If I understand insertMethod correctly, the third argument should be the names
of the formal arguments of the method. However, this fails if the signature is
something like "c('x', 'i', 'j', 'drop')" and the formal args are "c('x', 'i',
'j', '...', 'drop')" because the "..." gets passed instead of "drop". Changing
this to

allMethods <- insertMethod(allMethods, signature, fnames[match(signature,
fnames)], 
        asMethodDefinition(definition, signature))

seems to solve the problem.




-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._