Skip to content
Back to formatted view

Raw Message

Message-ID: <8b356f880902111021o156cabc5p441f3c59f4420529@mail.gmail.com>
Date: 2009-02-11T18:21:41Z
From: Stavros Macrakis
Subject: How to comment in R
In-Reply-To: <B37C0A15B8FB3C468B5BC7EBC7DA14CC61CA17F381@LP-EXMBVS10.CO.IHC.COM>

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.

           -s

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. :-)