In the spirit of this, but AFAIK not due to lazy evaluation, here's
another illustration why it's easy to mistakes when doing "inline"
assignments:
> x <- 0
> TRUE && (x <- 1)
[1] TRUE
> x
[1] 1
> FALSE && (x <- 2)
[1] FALSE
> x
[1] 1
> (x <- 3) && FALSE
[1] FALSE
> x
[1] 3
> FALSE & (x <- 4)
[
On Jan 12, 2013, at 17:02 , Gabor Grothendieck wrote:
> The is.pos function below results in the variable, out, being set to
> TRUE if the first argument to is.pos is positive and to FALSE
> otherwise.
>
> It does this without using the return value or using scoping tricks to
> reach into the ca
The is.pos function below results in the variable, out, being set to
TRUE if the first argument to is.pos is positive and to FALSE
otherwise.
It does this without using the return value or using scoping tricks to
reach into the caller. Instead it tricks the promise into
communicating one bit of i