/////////////////
setClass("B0", representation(b0 = "numeric"))
setClass("B1", representation("B0", b1 = "character"))
setClass("B2", representation("B1", b2 = "logical"))
f <- function(x) class(x)
setMethod("f", "B0", function(x) c(x at b0, callNextMethod()))
setMethod("f", "B1", function(x) c(x at b1,x at b0*x at b0,callNextMethod()))
setMethod("f", "B2", function(x) c(x at b2, callNextMethod()))
b0 <- new("B0", b0 = 3)
b1 <- new("B1", b1 = "deux", b0 = 2)
b2 <- new("B2", b2 = FALSE, b1 = "dix", b0 = 10)
f(b0)
f(b1)
f(b2)
///////////////////////////
Error in get(x, envir, mode, inherits) : variable ".Generic" was not found
//////////////////////////////
I'm using R Version 1.7.0, on a linux machine.
Thanks for your help.
Laurent B.