Retaining comments when using `example'

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
28 Jul 1999 01:38:00 +0200


Douglas Bates <bates@stat.wisc.edu> writes:

> Is there a way to retain the comments?  I notice that `example' ends up
> calling the `source' function to do the actual running of the code.

Yeowch! This was not easy with the old comment-as-attribute model, and
it certainly did not get easier with the new keep-function-source
semantics.

The real trouble is - I suspect - an ancient one, inherited from S:

	source() doesn't

I.e. it does not work in the same way as the source command in a shell
would, interpreting a file as if it had been lines entered on the
command line, with some provision for skipping back to interactive
mode if there's an error. Rather, it parses the entire file (and
syntax checks it) and runs the resulting parsed expression. 

Perhaps we need a "real" source()?

-- 
   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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._