Re: [Rd] bindingIsLocked returns illogical logical

2006-05-15 Thread Seth Falcon
Prof Brian Ripley <[EMAIL PROTECTED]> writes: > On Mon, 15 May 2006, Seth Falcon wrote: >> Is it enough to check for NA_LOGICAL or should all NA_* values be >> checked for? Is there an easier/better way to do this sort of check? > > NA_LOGICAL and NA_INTEGER are the same value, and only NA_LOGICA

Re: [Rd] bindingIsLocked returns illogical logical

2006-05-15 Thread Prof Brian Ripley
On Mon, 15 May 2006, Seth Falcon wrote: > Prof Brian Ripley <[EMAIL PROTECTED]> writes: > >> On Sun, 14 May 2006, Seth Falcon wrote: >>> I wonder if ScalarLogical should force 0/1: >> >> Not a good idea: what about the third value, NA? > > Indeed, I should have been sleeping (or perhaps I was alre

Re: [Rd] bindingIsLocked returns illogical logical

2006-05-15 Thread Seth Falcon
Prof Brian Ripley <[EMAIL PROTECTED]> writes: > On Sun, 14 May 2006, Seth Falcon wrote: >> I wonder if ScalarLogical should force 0/1: > > Not a good idea: what about the third value, NA? Indeed, I should have been sleeping (or perhaps I was already :-) Is it enough to check for NA_LOGICAL or sh

Re: [Rd] bindingIsLocked returns illogical logical

2006-05-15 Thread Prof Brian Ripley
On Sun, 14 May 2006, Seth Falcon wrote: > Martin Morgan <[EMAIL PROTECTED]> writes: > >> bindingIsLocked applied to a locked binding returns a 'logical' that >> is niether true nor false. > > Is this a philosophical question? :-) But there is such a value defined for R logical vectors. > Here's

Re: [Rd] bindingIsLocked returns illogical logical

2006-05-14 Thread Seth Falcon
Martin Morgan <[EMAIL PROTECTED]> writes: > bindingIsLocked applied to a locked binding returns a 'logical' that > is niether true nor false. Is this a philosophical question? :-) Here's what I think is going on: BINDING_IS_LOCKED does not return 0/1, but the result of a bit op that will be eit

[Rd] bindingIsLocked returns illogical logical

2006-05-14 Thread Martin Morgan
bindingIsLocked applied to a locked binding returns a 'logical' that is niether true nor false. Martin > e <- new.env() > e$x <- 1 > e$y <- 2 > lockBinding("x", e) NULL > bindingIsLocked("x", e) [1] TRUE > bindingIsLocked("x", e)==TRUE [1] FALSE > bindingIsLocked("x", e)==FALSE [1] FALSE > bindin