Re^2: Why nested comments not allowed?

bethge at wums.wustl.edu bethge at wums.wustl.edu
Thu Feb 22 03:00:31 AEST 1990


In article <1990Feb20.165353.14212 at uncecs.edu>, utoddl at uncecs.edu
(Todd M. Lewis) writes:
> You have quite precisely missed my point.  It was even in quotes.  Briefly:
>    1)  "comment out a section..."      Use comments.
>    2)  "compile if x {not} defined"    Use #if{n}def/#endif.
> See the difference?  In particular, I did not say that nested comments are
> the better way to suppress the compilation of a section of code. If it's a
> comment it isn't code!  The notion of conditionally compiling comments is
> a bit off the mark, IMHO.  Comments are never compiled--nothing conditional
> about that.  Lexed or parsed maybe, but not compiled.
>   It isn't a religious issue. It is a semantic issue--on two levels, no less.
> On the lower level, what I said is not what you thought I meant.  On the
> higher level, #ifdef/#endif and nested comments are not the same although
> the end result may be the same.

OK, I am not understanding you.  Can you enlighten me?  My question is,
*why* do you want nested comments?  I asked this question in a previous
posting, to which no one responded.  As I said then, the only use I can
think  of  is  to  suppress  the  compilation  of  a  section  of  code
(containing comments), by turning it into a comment.  This  is  what  I
understand to be the meaning of the phrase "comment out a section...".

I know that the *mechanisms* of #ifdef/#endif and nested  comments  are
different.   But  if the *purpose* is the same, and the *end result* is
the same, why are both needed?  Do you object the the introduction of a
bogus undefined identifier, as in
        #ifdef YES_COMPILE_THIS_HERE_BIT_OF_HACKWORK
        . . .
        #endif
or what?

Or is there really some other use for nested comments?  If there is,  I
don't want to remain ignorant of it.

No sarcasm intended.  I really am seeking enlightenment.

_______________________________________________________________________
Paul H. Bethge                                    bethge at wums.wustl.edu
Biochemistry, Box 8231                               bethge at wums.bitnet
Washington University
St. Louis, MO 63110                                        314-362-3354



More information about the Comp.lang.c mailing list