[R] Block comments in R?

Martin Maechler maechler at stat.math.ethz.ch
Thu Oct 5 16:57:14 CEST 2006


>>>>> "PD" == Peter Dalgaard <p.dalgaard at biostat.ku.dk>
>>>>>     on 05 Oct 2006 16:12:50 +0200 writes:

    PD> Seth Falcon <sfalcon at fhcrc.org> writes:
    >> Uwe Ligges <ligges at statistik.uni-dortmund.de> writes:
    >> > Use an editor that comments out a whole block which is what I do all the 
    >> > time, e.g. use Tinn-R, Emacs or WinEdt, to mention just a few of
    >> > them.
    >> 
    >> This, of course, works.  The if(FALSE) approach does not because it
    >> requires the "comment" to be syntactically correct.  The multiline
    >> string trick is _almost_ there, the problem is that both " and ' are
    >> fairly common in text and having to escape that is a pain.  
    >> 
    >> My wtf feature request is to add a multiline string delimiter ala
    >> Python like """.

    PD> Still gives you problems with nested comments. *IF* we want to go down
    PD> that route, we should have directional symbols like

    PD> <<<
    PD> dsaldfysdfk
    >>>> 

    PD> (which would likely drive version control users up the wall...)

i.e. all of R-core ...

    PD> or 

    PD> /# kdlsfk 
    PD> dfkjsdfl #/

    PD> (but those character combinations have a marginal risk of being used
    PD> in existing code).

or

<##  ....
      ...
 ##>

but I'm not yet fond of the general idea.
Martin


    PD> -- 
    PD> O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
    PD> c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
    PD> (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
    PD> ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



More information about the R-help mailing list