As a general rule, I expect "multi-line" comments to be comments that just
disappear when compiled.

Oh, and this will likely make the implementation of comments more
complicated, but would it be possible to make these comments "nested"?  It
has always bugged me, where multi-line comments are allowed, that you can't
comment out blocks with multi-line comments in them.  For example:

#include iosys.h

/* Let's comment out this function for debugging purposes
int test(int m, int n) {
    /* Here is a comment that
       spans multiple lines */
    return m+n;
} */

void main(void) {
    return 0;
}

In attempting to comment out the function, I fail, because the block only
goes to the first */ rather than the second.  If a block has several such
sub-blocks, it becomes a great pain to go back and forth, "breaking" and
then "fixing" the blocks, if you have reason to go back and forth between
commenting and uncommenting the outer comment.

To me, this has *always* been broken.  I'd like to see it fixed! :-)

Of course, if you had a string like "FORTH has a */ operator." somewhere, I
don't know what would happen in C if you tried to put it in a comment block
(my guess: Bad Things), but such a case is easily handled by escaping
methods of some sort.


On Thu, Aug 2, 2012 at 8:17 AM, David A. Wheeler <dwhee...@dwheeler.com>wrote:

> Alan Manuel Gloria
> > Before, when planning out multiline comments, I thought that:
> >
> > #|comment|# foo bar
> >
> > would be equivalent to:
> >
> > \\ foo bar
> ...
> > However, when I implemented it, I completely forgot to consider the
> > following case:
> >
> > foo #|comment|# bar
> >
> > The current implementation on 0.3.0 yields:
> >
> > foo
> > bar
> >
> > Should it?  I think the intent here would be that it would become
> > something like:
> >
> > foo bar
> >
> > then
> >
> > (foo bar)
> >
> > Should I fix this?  Is this indeed a bug?
>
> I think it's a bug.  It's certainly not what I would have expected.
>  Please *do* fix it!
>
> --- David A. Wheeler
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Readable-discuss mailing list
> Readable-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/readable-discuss
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to