[R] Can we get rid of && and ||?

GB gb at stat.umu.se
Thu Apr 13 15:58:28 CEST 2000


Bill,

thank you for the lesson! Just one question:

[snip]
> I think you miss the point quite seriously.   

No and yes.

> Under the present semantics
> in 'a & b' *both* a and b are *guaranteed* unconditionally to be evaluated,

I didn't miss this.

> and in a lazy evaluation language, especially, that unconditional evaluation
> can be vital.   

I missed this. And I don't quite understand it (yet). In 'a && b', why
would it be vital to evaluate  b  if  a  is  FALSE? Of course, in a
construct like 'a && (b <- c)' it would, but isn't 'b <- c; a && b' more
readible and to be recommended? (Or does the former code execute faster?)
I think I need a good example here. Can you give me one?

Once again, thanks!

Göran
----------------------------------------------------------
 Göran Broström                      tel: +46 90 786-5223
 Department of Statistics            
 Umeå University                                         
 SE-90187 Umeå, Sweden              email: gb at stat.umu.se
----------------------------------------------------------

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list