Re: R-alpha: ! incompatibility

Thomas Lumley (thomas@biostat.washington.edu)
Tue, 17 Sep 1996 09:21:33 -0700 (PDT)


Date: Tue, 17 Sep 1996 09:21:33 -0700 (PDT)
From: Thomas Lumley <thomas@biostat.washington.edu>
To: Ross Ihaka <ihaka@stat.auckland.ac.nz>
Subject: Re: R-alpha: ! incompatibility
In-Reply-To: <199609170510.RAA17066@stat.auckland.ac.nz>

On Tue, 17 Sep 1996, Ross Ihaka wrote:
> Thomas Lumley writes:
>  > 
>  > Another minor incompatibility
>  > R>if (!1) T else F
>  > Error: unary ! is only defined for logical vectors
> 
> This was a deliberate ``design'' choice, designed to help detect bugs.
> It would be very easy to change.  Is it important?

Personally, I would always use as.logical(). It depends on how many 
changes you want to make in ported S code.  This, and as.foo() working on 
NULLs are common assumptions in the only large block of S code I've read, 
but they're both easy to find and change.  Since you will have to edit 
any new S library to turn <- into :=, some more editing steps don't seem 
to be a problem.

 My preference would be for as.foo() to work on NULLs but I don't care one
way or the other about ! as long as I know it works differently in R.

thomas lumley
U Washington
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- To (un)subscribe, send
subscribe	or	unsubscribe
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-