[Rd] Internal flag for S4 objects

John Chambers jmc at r-project.org
Sun Sep 3 17:53:46 CEST 2006


A recent revision (svn version 39077) has introduced an internal flag (a 
bit in the C structure) that is turned on by the code that generates 
objects from an S4 class.

There are corresponding tests for an S4 object, isS4() in R and 
IS_S4_OBJECT() in C.  These are fast and reliable, and should replace 
any heuristic tests previously used.

The tests are not currently used widely, but in the future could be 
combined with some of the other recent changes to improve reliability 
and efficiency of computations with S4 objects.  Most such changes are 
more likely for 2.5.x than 2.4.0.

S4 objects in saved sessions and other binary files will not have the 
bit set, so they should be regenerated.  A likely symptom that you have 
not done so is that the objects will not print automatically with the 
standard S4 method, because the internal code now checks for an S4 
object before dispatching show().

John




More information about the R-devel mailing list