[Rd] the empty class name

Martin Maechler maechler at stat.math.ethz.ch
Wed Sep 17 12:48:02 MEST 2003


As Henrik Bengtsson has just demonstrated on R-help,
it is currently valid to have *the* empty class name.
E.g.,
----------------------------------
print. <- function(x, ...) { 
       cat("Empty class ", x,"\n") 
       invisible(x) 
}

x <- 1:2; class(x) <- "" 
----------------------------------

works:

  > x
  Empty class  1 2 

I see that it also works in S+6  but still do wonder if this is
not rather an accident than a feature.

Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><



More information about the R-devel mailing list