[Rd] Overloading methods in R

Ali - saveez at hotmail.com
Thu Apr 21 16:03:57 CEST 2005


Thanks a lot for the reply Henrik.

I do not know what was the motivation of R developers to go for yet another 
OO design, but I wish the designers would have thought of ways to interface 
this design to the other designs.

As a wrapper developer, I like packages like R.oo not because it uses S3, 
but for this reason that it 'hides' the OO design of R -- I don't mind if 
the hidden design is S3, S4 or maybe S5!


>However, in S3 you can create a "generic" generic function by not 
>specifying
>arguments but only '...' - this way any methods can take any arguments (and
>you don't force your argument names onto other developer's).

So why did they go a step backward in S4 and remov this feature?

>
>So, the above is just a sketch that might or might not work. I think you
>best shot is indeed to use S3, because it is a bit more flexible; S4 is
>probably too rigid for this purpose.

It seems to me by making the parser a bit less dynamic and putting some 
limitations this could be done.

>BTW, I think it would be nice if you can develope an easy way to define
>wrappers for C++ and other similar language! [Just don't reinvent the
>wheel.]

I assume you mean C++ wrappers for R. I believe before touching a project 
like that, first some issues must be resolved in R. The problem is not how 
to automate the parser, the problem is that OO design of R lacks some 
important equivalents of OO designs like C++. Another problem could be that 
some R developers believe that the previous is not a problem :) Once a 
flexible and stable interface between the two designs is estabilished, 
parsing may be perfomed in the classical way.



More information about the R-devel mailing list