Please let's not waste any time trying to figure out how to add
block comments to R.  In any guise they are highly error prone.
Although its precursors (PL/I and Pascal) had block comments and did not
have end-of-line comments, the programming language Ada was explicitly
designed to have end-of-line comments and not block comments, as block
comments were thought too easy to write incorrectly and too easy to misread.

As just one example, the version of vim I have does syntax highlighting,
BUT "Vim doesn't parse the whole file", so if you have code in the middle
of a block comment it may be highlighed incorrectly.

Commenting code out and providing documentation comments are easily
done with a good editor, although R documentation comments really belong
in files where help() can find them.

In the text editor I use, comment-region (using end-of-line comments)
and uncomment-region (ditto) are just two keystrokes each; it's
LESS effort than writing block comment delimiters would be.
Also, when writing a big comment, the newline key automatically
copies <white space>*(<end of line comment mark> <white space>*)?
to the beginning of a new line, so again it is less typing to make
a block comment using end-of-line comments than /* ... */ or anything
like that, and of course fill-paragraph and justify-paragraph (two
keystrokes each) can cope with the comment marks (a change from lines
with comment marks to ones without, or vice versa, constitutes a
paragraph break).

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to