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

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). :-)

-- 
Bj?rn-Helge Mevik



[Rd] R 2.6.0 S4 data breakage, R _data_class(), class<-, etc.
=?iso-8859-1?q?Bj=F8rn-Helge_Mevik?=