[Rd] WishList: Remove Generic Arguments

Abs Spurdle @purdle@@ @ending from gm@il@com
Thu Aug 9 23:45:29 CEST 2018

 I apologize if this issue has been raised before.

I really like object oriented S3 programming.
However, there's one feature of object oriented S3 programming that I don't
Generic functions can have arguments other than dots.

Lets say you have an R package with something like:

print.myfunction (f, ...)
{   dosomething (f, ...)

Noting that I use function objects a lot.

R CMD check will generate a warning because you've named your object f
rather than x.

I don't want to name my object x.
I want to name my object f.
Naming the object x makes the program unreadable.
Especially if f contains an attribute or an argument named x.

There's a work around.
You can redefine the print function, using something like:

print = function (...) base::print (...)

However, you have to export and document the function.

I think that it would be better if generic functions didn't have any
arguments except for dots.

	[[alternative HTML version deleted]]

More information about the R-devel mailing list