From takahashi.kohske at gmail.com  Thu Jun 21 07:26:48 2012
From: takahashi.kohske at gmail.com (Kohske Takahashi)
Date: Thu, 21 Jun 2012 14:26:48 +0900
Subject: [Rd] "Incompatible methods" for overloaded operator
In-Reply-To: <CAFOpNVHQ186dGQLtiO=0TFB2sjqx+j7_aczoAcHqp+sPq7xWmw@mail.gmail.com>
References: <CAFOpNVFyqaTZHG15N2w13OqBJSwdVfdpbWGfsJim3XhNCmdYfw@mail.gmail.com>
	<CABdHhvF-WRwa9QaXG7Tb6JoiZJYH70OzUSdvAwUSY_6ZTnWvHQ@mail.gmail.com>
	<4FE28E2D.7050205@fhcrc.org>
	<CABdHhvGKRgTTSJRQUS3pu_GDLTJkk0HBTpinHvFTJn1zA7E+qA@mail.gmail.com>
	<4FE299B9.2080400@fhcrc.org>
	<CAFOpNVHQ186dGQLtiO=0TFB2sjqx+j7_aczoAcHqp+sPq7xWmw@mail.gmail.com>
Message-ID: <CAC-jPZqs3KXyTNw20rYT++us4852q3ugqehYYrEGOwNcidgiVQ@mail.gmail.com>

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 at 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



[Rd] "Incompatible methods" for overloaded operator
Kohske Takahashi