[Rd] library(methods): setMethod with "ANY" fails. (PR#1317)

John Chambers jmc@research.bell-labs.com
Tue, 19 Feb 2002 18:49:30 -0500


hb@maths.lth.se wrote:
> 
> Full_Name: Henrik Bengtsson
> Version: R v1.4.1
> OS: WinMe
> Submission from: (NULL) (217.208.14.137)
> 
> Doing the following
> 
> library(methods)
> setGeneric("foo", function(x) standardGeneric("foo"))
> setMethod("foo", "ANY", function(x) cat(x))
> 
> fails with
> 
> Error in while (value[n] == "ANY") n <- n - 1 :
>         missing value where logical needed
> 
> It looks like the line
> 
>   while (value[n] == "ANY") n <- n - 1
> 
> in the source for matchSignature() should be
> 
>   while (n > 0 && value[n] == "ANY") n <- n - 1
> 
> FYI: I tried my suggested modification at it seems to work.

Yes, thanks, that's correct.

It had been fixed in r-patched and r-devel, but too late for 1.4.1.


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