What is callGeneric used for?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

What is callGeneric used for?

Seth Falcon-2
I've recently come across two pieces of code using calls to
callGeneric() inside the definition of a method.

In both cases, it appears to me that the callGeneric call could be
replaced with a "real" call to the generic, say foo(x) instead of
callGeneric(x) inside method foo.

My understanding from the docs is that when called with arguments, it
is just like calling the actual generic.  Clear enough, but what does
this provide that just calling the actual generic doesn't?

Similarly, when would one want to make the recursive call that results
from calling callGeneric with no args?

Thanks,

+ seth

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: What is callGeneric used for?

Gabor Grothendieck
In the case of arithmetic methods you might not know or care
whether the generic is, say, + or -.

On 5/10/06, Seth Falcon <[hidden email]> wrote:

> I've recently come across two pieces of code using calls to
> callGeneric() inside the definition of a method.
>
> In both cases, it appears to me that the callGeneric call could be
> replaced with a "real" call to the generic, say foo(x) instead of
> callGeneric(x) inside method foo.
>
> My understanding from the docs is that when called with arguments, it
> is just like calling the actual generic.  Clear enough, but what does
> this provide that just calling the actual generic doesn't?
>
> Similarly, when would one want to make the recursive call that results
> from calling callGeneric with no args?
>
> Thanks,
>
> + seth
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel