[Rd] callNextMethod fails with "$" generic

Vitalie S. spinuvit.list at gmail.com
Wed Nov 10 13:49:19 CET 2010


Dear Developers,

callNextMethods does not work with "$"

setClass("mylist", contains = "list"):
setMethod("$",
          signature(x = "mylist"),
          function (x, name){
              cat("here:\n")
              callNextMethod()
          })

tl <- new("mylist")
tl[["x"]] <- 343

tl$x
#here:
#NULL


If I use callNextMethod(x=x, name=name)

this error is issued:

Error in function (classes, fdef, mtable)  :
  unable to find an inherited method for function "addNextMethod", for signature "function"

It must be something "$" specific. If the above is an expected behavior , how
should I call next method for "$" generic?

My info:
R version 2.12.0 Patched (2010-11-01 r53513)
Platform: i386-pc-mingw32/i386 (32-bit)

Same behavior for official R 2.12.0.

Thanks,
Vitalie.



More information about the R-devel mailing list