Re: [Rd] match gets confused by S4 objects

2006-02-07 Thread Martin Maechler
> "Seth" == Seth Falcon <[EMAIL PROTECTED]> > on Tue, 07 Feb 2006 07:20:17 -0800 writes: Seth> On 7 Feb 2006, [EMAIL PROTECTED] wrote: >> The solution has been agreed to be changing the internal >> representation of S4 objects making them a new SEXP (basic R >> "type")

Re: [Rd] match gets confused by S4 objects

2006-02-07 Thread John Chambers
In fact there is a heuristic test that is cheap and reasonably reliable. The class attribute generated for S4 objects itself has an attribute, "package". A C-level test for the existence of that attribute is cheap enough, I would think, that most anti-S4 users wouldn't notice it in match(), c

Re: [Rd] match gets confused by S4 objects

2006-02-07 Thread Seth Falcon
On 7 Feb 2006, [EMAIL PROTECTED] wrote: > The solution has been agreed to be changing the internal > representation of S4 objects making them a new SEXP (basic R > "type"); and as Brian alludes to, the problem is that those in > R-core that want to and are able to do this didn't have the time > fo

Re: [Rd] match gets confused by S4 objects

2006-02-07 Thread Martin Maechler
> "BDR" == Prof Brian Ripley <[EMAIL PROTECTED]> > on Mon, 6 Feb 2006 19:44:50 + (GMT) writes: BDR> An S4 object is just a list with attributes, so a BDR> vector type. match() works with all vector types BDR> including lists, as you found out (or could have read). yes

Re: [Rd] match gets confused by S4 objects

2006-02-06 Thread Prof Brian Ripley
An S4 object is just a list with attributes, so a vector type. match() works with all vector types including lists, as you found out (or could have read). If in the future those proposing it do re-implement an S4 object as an new SEXP then this will change, but for now the cost of detecting ob

[Rd] match gets confused by S4 objects

2006-02-06 Thread Seth Falcon
If one accidentally calls match(x, obj), where obj is any S4 instance, the result is NA. I was expecting an error because, in general, if a match method is not defined for a particular S4 class, I don't know what a reasonable default could be. Specifically, here's what I see setClass("FOO", re