> If x is not a sensible name within the print.myfunction() method, then
there's a one line fix:
>
> print.myfunction <- function(x, ...) {
> f <- x
> dosomething(f)
> }
Naming the argument x is not an option.
>> print = function (...) base::print (...)
> That's a really, really bad idea.
On 09/08/2018 5:45 PM, Abs Spurdle wrote:
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
like.
Generic functions can have arguments other than dots.
Lets say you have a
A generic function is not simply a way to name two functions (methods)
the same. It has a particular purpose, and the argument names are
aligned with and convey that purpose. The methods only implement
polymorphism; they don't change the purpose. Changing the purpose
would make code unreadable.
Mi
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
like.
Generic functions can have arguments other than dots.
Lets say you have an R package with something like:
print.myfun