[R] The object argument of NextMethod.

Gabor Grothendieck ggrothendieck at gmail.com
Fri Apr 14 20:22:10 CEST 2006


On 4/14/06, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:
> On Fri, 14 Apr 2006, ronggui wrote:
>
> > My question is when the object argument of NexthMethod be used?
>
> Looking at the C code, I don't think it is.  But look at do_nextmethod in
> src/main/objects.c yourself.
>
> Note that in your examples it would not make any difference as 'x'
> is re-evaluated in the current frame, and so passing it explicitly will
> find the same value.
>
> As far as I can tell, in NextMethod(generic, object, ...), 'generic' is
> only used if not invoked via a generic, and only named arguments in ...
> are used, to replace or append to the argument list of the current method.
>
> This is an area where R-lang is only a draft, and the definitive
> documentation is the C code.  The lack of precision seems not to be doing
> anyone much harm,

I spent a lot of time fighting with NextMethod in writing the dyn package
so its definitely doing significant harm in terms of time spent in development
since it does not work as documented.




More information about the R-help mailing list