[R] How to comment in R

Wacek Kusnierczyk Waclaw.Marcin.Kusnierczyk at idi.ntnu.no
Wed Feb 11 20:25:58 CET 2009


Stavros Macrakis wrote:
> On Wed, Feb 11, 2009 at 12:32 PM, Greg Snow <Greg.Snow at imail.org> wrote:
>   
>> ...The c-style of /* */ allows both types and you can comment out part of a line, but it is not simple to match and has its own restrictions.  Friedl in his regular expressions book takes 10 pages to develop a pattern to match these (and the final pattern is almost 2 full lines of text in the book).  And this is without allowing nesting....
>>     
>
> Though there is a real debate about the value of multiline, possibly
> nested, comments, the regular expression argument is a red herring.
> Lexical analysis of multiline comments is a solved problem (and not a
> particularly difficult one!), and matters only to language and editor
> implementors.  Emacs handles them with no problem.
>
>   

indeed.  but any argument is good to defend whatever has been or hasn't
been implemented in r.

>            
>
> PS And to give credit where credit is due (important on this mailing
> list), the /* */ syntax was defined by PL/I; C simply implemented an
> existing convention and popularized it. :-)
>   

it might be my fault, i was talking about c-style comments here, not
sure if i was the first to do so.

vQ

-- 
-------------------------------------------------------------------------------
Wacek Kusnierczyk, MD PhD

Email: waku at idi.ntnu.no
Phone: +47 73591875, +47 72574609

Department of Computer and Information Science (IDI)
Faculty of Information Technology, Mathematics and Electrical Engineering (IME)
Norwegian University of Science and Technology (NTNU)
Sem Saelands vei 7, 7491 Trondheim, Norway
Room itv303

Bioinformatics & Gene Regulation Group
Department of Cancer Research and Molecular Medicine (IKM)
Faculty of Medicine (DMF)
Norwegian University of Science and Technology (NTNU)
Laboratory Center, Erling Skjalgsons gt. 1, 7030 Trondheim, Norway
Room 231.05.060




More information about the R-help mailing list