From Waclaw.Marcin.Kusnierczyk at idi.ntnu.no  Mon Mar 23 21:27:11 2009
From: Waclaw.Marcin.Kusnierczyk at idi.ntnu.no (Wacek Kusnierczyk)
Date: Mon, 23 Mar 2009 21:27:11 +0100
Subject: [Rd] incoherent treatment of NULL
In-Reply-To: <18887.47565.277797.490023@lynne.math.ethz.ch>
References: <49C74DC3.3090700@idi.ntnu.no>	<18887.22657.574884.473000@lynne.math.ethz.ch>	<49C75CD5.10903@idi.ntnu.no>	<18887.41024.25380.419956@lynne.math.ethz.ch>	<49C7A688.7080501@idi.ntnu.no>
	<18887.47565.277797.490023@lynne.math.ethz.ch>
Message-ID: <49C7F09F.10301@idi.ntnu.no>

Martin Maechler wrote:
>
>     >> more verbously,  all NULL objects in R are identical, or as the
>     >> help page says, there's only ``*The* NULL Object'' in R,
>     >> i.e., NULL cannot get any attributes.
>     >> 
>
>     WK> yes, but that's not the issue.  the issue is that names(x)<- seems to
>     WK> try to attach an attribute to NULL, while it could, in principle, do the
>     WK> same as class(x)<-, i.e., coerce x to some type (and hence attach the
>     WK> name attribute not to NULL, but to the coerced-to object).
>
> yes, it could;  but really, the  fact that  'class<-' works is
> the exception.  The other variants (with the error message) are
> the rule.
>   

ok.

> Also, note (here and further below),
> that Using   "class(.) <-  <className>"
> is an S3 idiom   and S3 classes  ``don't really exist'', 
> the "class" attribute being a useful hack,
> and many of us would rather like to work and improve working
> with S4 classes (& generics & methods) than to fiddle with  'class<-'.
>
> In S4, you'd  use  setClass(.), new(.) and  setAs(.),
> typically, for defining and changing classes of objects.
>
> But maybe I have now lead you into a direction I will later
> regret, 
> ....
> when you start telling us about the perceived inconsistencies of
> S4 classes, methods, etc.
> BTW: If you go there, please do use  R 2.9.0 (or newer)
>   

using latest r-devel for the most part.

i think you will probably not regret your words;  from what i've seen
already, s4 classes are the last thing i'd ever try to learn in r.  but
yes, there would certainly be lots of issues to complain about.  i'll
rather wait for s5.

regards,
vQ



[Rd] incoherent treatment of NULL
Wacek Kusnierczyk