[R] Drawing Trig Function

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Wed May 31 12:25:00 CEST 2000


Ben Bolker <ben at zoo.ufl.edu> writes:

> if (FALSE) {}
> 
> around the stuff you want to comment out.
> This won't work if you have open parentheses or other "syntax errors" in
> the commented region.

..and if you use it to remove largish blocks in scripts fed to stdin,
you'll notice that it takes quit a lot of time. This is due to a
current silliness in the R parser: Whenever we see a newline, we check
whether the expression is complete. If so, then we evaluate it,
otherwise we *reparse* what has already been seen, adding another
line. This makes parsing O(k^2) in the number of lines in an
expression which is really unnecessary. It's just that noone has
figured out how to do the required checkpointing of the bison/yacc
parser yet. The effect doesn't happen when you source() files, because
in that case we always parse the entire file before executing it.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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