Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/17/84; site opus.UUCP
Path: utzoo!linus!philabs!cmcl2!seismo!hao!cires!nbires!opus!rcd
From: rcd@opus.UUCP (Dick Dunn)
Newsgroups: net.lang.c
Subject: Re: Standardization questions -- nested comments
Message-ID: <886@opus.UUCP>
Date: Thu, 11-Oct-84 21:55:28 EDT
Article-I.D.: opus.886
Posted: Thu Oct 11 21:55:28 1984
Date-Received: Sat, 13-Oct-84 04:02:11 EDT
References: <12904@sri-arpa.UUCP>
Organization: NBI,Inc, Boulder CO
Lines: 31

One recent idea was to have an occurrence of "/*" within a comment generate
a warning.  I suppose I could live with that as long as I can shut off
the warning (since I would use an alias or some such to disable it all
the time).  Another suggestion:

> From:   Paul Schauble 
> 
> Has anyone considered making /* and */ nest properly, so that one could
> comment out commented code??

It bothers me a little that it seems necessary to start complicating the
structure of comments.  For C, I really think we can live with what we've
got.  In another language design, there are probably better ways to
go--such as Ada's "--" which is ALWAYS terminated at end of line.
(Commenting out a section of code is easy; just prefix each line with --.)
Another approach is to have two forms such as (* *) vs { } in Pascal BUT
don't allow matching (* with } or { with *)--this is clumsier but can be
made to work.

Examining the interior of comments CAN get in the way.  Once upon a time
there was a not-quite-brilliant idea that Pascal compilers should make an
effort to detect an unclosed comment.  (I think it was in one of the drafts
of the Standard; I have no idea whether it stayed.)  This begat some odd
solutions--one of the worst being a compiler warning on any occurrence of a
semicolon within a comment.  Of course, if you write normal text in
comments you'll punctuate it and the compiler makes a lot of racket.  So
you turn off warning messages and miss all of the nice things like "this
variable is probably used before it is set."
-- 
Dick Dunn	{hao,ucbvax,allegra}!nbires!rcd		(303)444-5710 x3086
   ...Relax...don't worry...have a homebrew.