On Sat, 10 Aug 2019 at 21:11, Lenth, Russell V <russell-le...@uiowa.edu> wrote:
>
> Thanks Iñaki,
>
> However...
>
>     > 1) renaming those methods (e.g., recover_data_foo, because as soon as 
> there is a something.foo
>     > in your namespace, it will be dispatched regardless of whether you 
> register it or not)
>
> If I do that, then emmeans won't support foo objects until foopkg offers the 
> methods. My goal is to encourage package developers to replace my existing 
> methods but to support them until that is done.

A method doesn't need to be named something.foo to register it for foo
objects. You can register any function name as a method for any class
and any generic, thus avoiding the automatic dispatch on these special
names *.foo.

What I'm suggesting is that, in .onLoad, if getS3method returns
something for recover_data and class foo, then that's fine. If not,
you can register you recover_data_foo.

Iñaki

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to