Skip to content
Prev 3546 / 63424 Next

is.null(list()) is FALSE ?

On Tue, 21 Mar 2000, Torsten Hothorn wrote:

            
My guess is that this dates from old-style pairlists, where list() could
easily be NULL. Now a list is internally a vector, so list() is a vector
of length zero and so is stored as a VECTOR node.

Also, a difficulty with storing list() as NULL is that you can't set
attributes on NULL:
R> a<-NULL
R> attr(a,"foo")<-"bar"
Error: attempt to set an attribute on NULL
R> a<-list()
R> attr(a,"foo")<-"bar"
R> a
list()
attr(,"foo")
[1] "bar"


	-thomas

Thomas Lumley
Assistant Professor, Biostatistics
University of Washington, Seattle

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._