From mehmet.suzen at gmail.com  Thu Nov 30 03:14:49 2017
From: mehmet.suzen at gmail.com (Suzen, Mehmet)
Date: Thu, 30 Nov 2017 03:14:49 +0100
Subject: [Rd] binary form of is() contradicts its unary form
In-Reply-To: <5A1F1C60.9080506@fredhutch.org>
References: <5A1EF8DB.6080401@fredhutch.org>
 <CAPtbhHzXe3=EBW6wwyx1Hh158qjBrC0vfFbh4+o3bRZTC+c5Kw@mail.gmail.com>
 <5A1F0EB3.7090508@fredhutch.org>
 <CAPtbhHws5Fydk0AHeq3Urh9qEZ4XM0C-BJtoRvUpnStb33G=mg@mail.gmail.com>
 <5A1F1C60.9080506@fredhutch.org>
Message-ID: <CAPtbhHy4=U8V-XRtg63=eS4PAWgqQM6=-xnSmVSgdPFbuv8dxw@mail.gmail.com>

On 29 November 2017 at 21:45, Herv? Pag?s <hpages at fredhutch.org> wrote:
> You're missing the point of my original post. Which is that
> there is a serious inconsistency between the unary and binary
> forms of is(). Maybe the binary form is right in case of

My understanding is that there is no inconsistency. `is` does what it
claims, from the documentation:

?is?: With two arguments, tests whether ?object? can be treated as
          from ?class2?.

          With one argument, returns all the super-classes of this
          object's class.

Important verb there is 'can be treated as from' with two arguments. So,
one can not treat `data.frame` as from 'list' class in a simple sense,
even though it inherits
from list. The complication is that list is a Primitive and this is
not coming from a
clean S4 hierarchy c.f, your A, B example.

Also, strictly speaking, having super-classes resolved does not
automatically qualify an
assumption that the object can be treated as a class of one of its
super-classes.

Cheers,
Mehmet



[Rd] binary form of is() contradicts its unary form
Suzen, Mehmet