Skip to content
Prev 56581 / 63421 Next

Discrepancy between is.list() and is(x, "list")

I know I said that I had no further comments on object oriented semantics.
However, I found a contradiction in the R documentation.
Gabriel Becker wrote:
"R object"

In the R Language Definition:
So, according the the R Language Defintion, all objects in R, are R objects.

However, in the help page for UseMethod(), which you've already mentioned:
tested by is.object).

So, according to this, an object in R, isn't necessarily an R object.

These are contradictory to each other.
And I believe that the R Language Definition is correct.
So, the help page for UseMethod() should be changed to match the language
definition.
Hadley Wickham wrote:
Note that the R Language Definition does not mention either "base types" or
"S3 classes".
So, should I be understanding *your* distinction between them?
Martin Maechler wrote:
S4 doesn't always do intuitive things, either.

Try the following example:
However, I still may consider using S4, especially where I would otherwise
use a named list.