On Fri, May 4, 2012 at 2:02 AM, R. Michael Weylandt <michael.weyla...@gmail.com> wrote: > Note that print.testclass(testlist) also works as expected so it might > be there's a forced evaluation somewhere inside S3 dispatch
Indeed. Without evaluating the argument, the S3 method dispatch can't work out which method to dispatch to. In principle it could go back and get a copy of the unevaluated promise, but it doesn't (and that would only move the problem somewhere else, since the evaluation could have side effects that would then happen multiple times) Section 5.4 of the R Language Definition says, in part, "When the method is invoked it is called with arguments that are the same in number and have the same names as in the call to the generic. They are matched to the arguments of the method according to the standard R rules for argument matching. However the object, i.e. the first argument has been evaluated." -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.