R-alpha: ==NULL

Martin Maechler Martin Maechler <maechler@stat.math.ethz.ch>
Thu, 1 May 97 17:47:36 +0200


>>>>> "Tom" == Thomas Lumley <thomas@biostat.washington.edu> writes:

    Tom> Any comparison with NULL generates an error Error: comparison is
    Tom> possible only for vector types whereas in S(-PLUS) it gives NA,
    Tom> which seems more sensible.

    Tom> Along similar lines, comparison with a length 0 vector returns
    Tom> logical(0) in R but NA in S.

Is n't  logical(0)  more  logical than  NA ?

I agree that it would be best  (convenience)
if   'NULL==1' returned the same as 'numeric(0)==1'.

At the moment, I don't see why compatibility with S  should be important
here:
		if( NULL == anything)  
or, e.g.,	if( numeric(0) == numeric(0) )

give an error anyway, i.e., you have to test for length 0 _anyway_
in the cases where one comparison argument may have zero length.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-