From Martin Maechler <maechler@stat.math.ethz.ch>  Fri May  2 10:28:11 1997
From: Martin Maechler <maechler@stat.math.ethz.ch> (Martin Maechler)
Date: Fri, 2 May 97 11:28:11 +0200
Subject: R-alpha: ==NULL
In-Reply-To: <Pine.SUN.3.95.970501092039.11571A-100000@avon> (message from
 Thomas Lumley on Thu, 1 May 1997 09:28:48 -0700 (PDT))
Message-ID: <9705020928.AA02005@>

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

    ThLu> On Thu, 1 May 1997, Martin Maechler wrote:
    >> >>>>> "Tom" == Thomas Lumley <thomas@biostat.washington.edu> writes:
    ThLu>    ^^^^^ Aaargh! Not "Tom", please.

Excuse me!

    >> ....

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

    ThLu> I didn't (previously) make any comment on this -- I only said
    ThLu> that NA was more logical than an error message.  However, the
    ThLu> advantage of returning NA is that NA | TRUE is TRUE, NA & FALSE
    ThLu> is FALSE, which doesn't happen with logical(0). Also, from a
    ThLu> compatibility point of view one of them is tested with is.na(),
    ThLu> the other with length(), so it can matter which one you use.  Of
    ThLu> course no-one should deliberately write code where it matters,
    ThLu> but these things happen.

Ok, given the above argument, returning NA is logical, too.
However, I'd also argue that  
	logical(0) | TRUE	-> TRUE
	logical(0) & FALSE      -> FALSE

	logical(0) & TRUE	-> logical(0)
	logical(0) | FALSE      -> logical(0)

    ThLu> It seems in fact that logical(0) | TRUE causes R to freeze
    ThLu> (R0.49, sparc solaris).

Yes:

> logical(0) | TRUE
Warning in logical(0) | TRUE : longer object length
        is not a multiple of shorter object length
Floating exception
~~~~~~~~~~~~~~~~~~ [and 'core' dump]
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


R-alpha: ==NULL
Martin Maechler