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")
[EMAIL PROTECTED] <- [EMAIL PROTECTED] + 1
.Object
})
setMethod("show", "A",
function(object) cat("An A like thing. x =", [EMAIL PROTECTED], "\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
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel