From mtmorgan at fhcrc.org  Mon Oct  8 15:59:17 2007
From: mtmorgan at fhcrc.org (Martin Morgan)
Date: Mon, 08 Oct 2007 06:59:17 -0700
Subject: [Rd] R 2.6.0 S4 data breakage, R _data_class(), class<-, etc.
In-Reply-To: <m0hcl27z5n.fsf@bar.nemo-project.org> 
	=?iso-8859-1?q?=28Bj=F8rn-Helge?= Mevik's message of "Mon,
	08 Oct 2007 11:07:16 +0200")
References: <470858F0.1090902@cimr.cam.ac.uk> <4708F0CF.4000308@r-project.org>
	<6phy7eeka26.fsf@gopher4.fhcrc.org>
	<m0hcl27z5n.fsf@bar.nemo-project.org>
Message-ID: <6phk5pxlnbe.fsf@gopher4.fhcrc.org>

bhs2 at mevik.net (Bj?rn-Helge Mevik) writes:

> Martin Morgan wrote:
>
>> But both 'new' and 'as' appear to produce invalid (in a different
>> sense, I guess) objects:
>>
>>> setClass("snp", contains="raw",
>> +          validity=function(object) {
>> +              if (length(object) < 1) "too short"
>> +              else TRUE
>> +          })
>
> Well, you _have_ designed a class with an invalid prototype (as
> determined by your own validity function). :-)

Yeah, its true I did, but the software let me get away with it. Even
with a valid protoytpe I can as(raw(), "snp").

Martin

> -- 
> Bj?rn-Helge Mevik
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] R 2.6.0 S4 data breakage, R _data_class(), class<-, etc.
Martin Morgan