Re: [Rd] "Incompatible methods" for overloaded operator

From: Kohske Takahashi <takahashi.kohske_at_gmail.com>
Date: Thu, 21 Jun 2012 14:26:48 +0900

In my view the class a and b should inherit same parent, like class c. And S3methods should be defined for the class c.

Actually, this is not a workaround.
It will go with the more oop-ish design.

kohske

2012/6/21 Winston Chang <winstonchang1_at_gmail.com>:
> On Wed, Jun 20, 2012 at 10:49 PM, Martin Morgan <mtmorgan@fhcrc.org> wrote:
>
>> On 06/20/2012 08:06 PM, Hadley Wickham wrote:
>>
>>> But aren't the methods compatible?  If equality doesn't make a method
>>> compatible what does?
>>>
>>
>> Actually I guess that turns out to be the key (to why they work at the
>> command line but not in a package).  At the command line they really _are_
>> the same, e.g., .Internal(inspect("+.a")) has the same  address as "+.b".
>> In the package they (e.g., badadd:::"+.a") have different addresses, I
>> suppose because S3method() acts on them independently.
>>
>>
> Thanks for the investigation. I wonder if there's some sort of workaround.
>
>
>
>>
>>> But unfortunately that doesn't work for S3 classes (even with
>>> setOldClass) so it doesn't help much unless we want to rewrite
>>> everything in S4 :/
>>>
>>
>> rewrite?
>>
>
> Yes, the original question is the result of some issues that came up in
> ggplot2 development...
>
> -Winston
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Kohske Takahashi <takahashi.kohske_at_gmail.com>

Assistant Professor,
Research Center for Advanced Science and Technology,
The University of  Tokyo, Japan.
http://www.fennel.rcast.u-tokyo.ac.jp/profilee_ktakahashi.html

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Thu 21 Jun 2012 - 11:13:07 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 25 Jun 2012 - 15:20:30 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive