Skip to content
Prev 40293 / 63424 Next

S3 method dispatch - can methods come from the enclosing environment?

Bill,

I suspect you have a typo there [class(x) instead of class(z)] which is why it doesn't work. Without the typo it does:
+   print.tst <- function(x, ...) cat("found it!")
+ 
+   function(x) print(x)
+ })
found it!

Cheers,
Simon
On May 17, 2011, at 7:32 PM, <Bill.Venables at csiro.au> <Bill.Venables at csiro.au> wrote: