develooper Front page | perl.perl6.language.mlc | Postings from August 2000

Re: Multiline comments. WAS:Re: Recording what we decided *not* to do, and why

Thread Previous | Thread Next
Glenn Linderman
August 7, 2000 13:57
Re: Multiline comments. WAS:Re: Recording what we decided *not* to do, and why
Message ID:
Hey! I finally got a message direct from -mlc!  Great!

This thread was not about multiline comments, but rather about in-line

I still think multiline comments should be


That in mind, below are my reactions to your examples

Michael Mathews wrote:

> I like this quite a lot. Heck, even a C programmer could like #* ... *# !
> I wonder though about backwards compatability. Let me clarify what you
> propose with some examples:
>     code here; #your typical comment here


>     some code; #*still a single line of comment, but how does parser know?

It doesn't, until it gets to the end of the line, doesn't find the terminating
*#, and decides the # meant end-of-line comment, not #* meaning in-line
comment, in this particular case.

I'd have the parser throw a warning for this situation (unterminated in-line

>     more code;
>     code #*inline comment here*# rest of code;


>     #*
>         block comment here
>     *#

Nope.  Gotta use

   block comment here

or your choice of other token instead of BLOCK_COMMENT.

>     code again;

I really believe that there is and should be a distinction between in-line and
multi-line comments, in order to be reasonably backward compatible.

The "#<<token" is big enough it won't be found by accident, but too big for
in-line comments.  The #< or #* is small enough for in-line comments, but
could have been used in single line comment days, so it better not
accidentally comment out a large block of code (there may be a ># or *#
somewhere later, so you'd get no warning).
There  are two kinds of people, those
who finish  what they start,  and  so
on...                 -- Robert Byrne

_____NetZero Free Internet Access and Email______

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About