[Rd] Off-topic: Pretty-printing R (or S) code with GNU a2ps

Peter Dalgaard BSA p.dalgaard@pubhealth.ku.dk
24 Feb 2001 01:00:46 +0100


Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at> writes:

> R-lang says:
> 
> 	The following identifiers have a special meaning and should not
> 	be used for object names
> 
> 	     if else repeat while function for in next break
> 	     TRUE FALSE NULL NA Inf NaN
> 	     ... ..1 ..2 etc.
> 
> so I think this is the list of keywords to use.
> 
> (Yes switch() is not in there ...)

switch() is technically a function call...

The true authority is the keywords[] array in gram.y, a study of which
indicates that ..1, ..2 et al. do bit count as keywords, whereas ...
does and we have an extra which was new to me, namely GLOBAL.ENV, and
truly enough:

> GLOBAL.ENV
<environment: R_GlobalEnv>
> GLOBAL.ENV <- 5
Error in <environment> <- 5 : invalid (do_set) left-hand side to
assignment

Wonder what that one is good for? The only symbolic reference to
it in the entire source is in gram.c, but I suppose its value gets
initialized somewhere. Looks like a relic from older times, but I
wouldn't dare to remove it for 1.2.2...


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