Old-style classes: bug fix & request

John Chambers jmc@research.bell-labs.com
Tue, 10 Sep 2002 11:46:46 -0400


Bug fix:

A bug introduced in version 1.6 failed to "initialize" some old-style
(aka "S3") classes, producing possible warning messages if those classes
were used in the signature of a method in the methods package.

The real bug, though, was that old-style inheritance could not be
included, until the setOldClass function was provided.  Initializing the
methods package now defines a number of old-style classes, some with
inheritance.

The bug & its fix are only relevant if you want to use old-style classes
in defining formal methods.

Request:

The request is for input on other classes that need to be included or
currently included classes not treated correctly.

Roughly, if there is an assignment of class in the base package that
does not break the consistency of classes, we should initialize that
class or classes via a call to setOldClass.  The discussion in
"Programming with Data", pp 449-451 covers some of the issues.

The list of old-style classes processed is in .OldClassesList in the
methods package.  Elements of the list are character vectors; each is
used in a call to setOldClass during initialization.  So elements of the
list with > 1 string define old-style inheritance.

There are a few known classes in the base package NOT currently
initialized:

- "noquote": The use of the "noquote" class breaks the class model
because it inserts a class name _after_ an arbitrary other class name,
changing the hierarchy from one object to another.  Can't be
consistently used in setOldClass.

- "listof" and "list.of".  It wasn't clear whether these are different
and if so, whether both should be included.

Ideally, we would like the call to setOldClass to be associated with the
package that uses the S3 class, but to do so requires using the methods
package in initializing the other package.

For the moment, the proposal is to handle in the methods package the
old-style classes in the base package.  For other packages, we need a
different solution.

John

-- 
John M. Chambers                  jmc@bell-labs.com
Bell Labs, Lucent Technologies    office: (908)582-2681
700 Mountain Avenue, Room 2C-282  fax:    (908)582-3340
Murray Hill, NJ  07974            web: http://www.cs.bell-labs.com/~jmc
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._