From sfalcon at fhcrc.org  Wed Oct 18 01:02:15 2006
From: sfalcon at fhcrc.org (Seth Falcon)
Date: Tue, 17 Oct 2006 16:02:15 -0700
Subject: [Rd] Caching bug with showMethods?
Message-ID: <m2ac3uv954.fsf@ziti.local>

showMethods isn't reporting inherited methods when it is first
called.  The methods are there and after calling them, showMethods
gives the right output.

Here is an example (using R-devel r39647):

setClass("A", representation(x="numeric"),
         prototype=list(x=1))

setClass("B", contains="A",
         prototype=list(x=2))

setMethod("initialize", "A",
          function(.Object) {
              cat("In A's init\n")
              .Object at x <- .Object at x + 1
              .Object
          })

setMethod("show", "A",
          function(object) cat("An A like thing. x =", object at x, "\n"))

showMethods(classes="B")  ## should give output, but doesn't
showMethods(classes="A")

aa <- new("A")
bb <- new("B")

aa
bb

## Now it will give output
showMethods(classes="B")




--
+ seth




[Rd] Caching bug with showMethods?
Seth Falcon