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

RFC v2

From:
Glenn Linderman
Date:
August 4, 2000 23:24
Subject:
RFC v2
Message ID:
398BB376.896F4260@Linderman.com
> =head2 Nesting
>
> Since multiline comments will have a beginning and an ending it will be
> possible to nest and overlap commented sections of perl. Nesting and
> overlapping should be allowed and supported. In the case of nesting, the
> outermost comment is enforced, in the case of overlapping the comments
> should be treated as if they were joined. In the case of a single-line
> comment overlapping a multiline comment, the multiline would end the
> sigle-line comment and would in all other ways take precedence.

Using a syntax with a user specified, multi-character delimiter, such as
that proposed in the last
section (#<<token \n\n\ntoken), it would seem that nesting comments can
be trivially implemented by
ignored nested comments.  Comment nesting is mostly an issue when short
(1-3 character) comment
delimiters are in use, and "commenting out" large blocks of code might
include internal comments,
which might accidentally cause early termination of the "commenting out"
function.

I suspect that with a here document style of syntax, that there would be
no need to interpret the
content of the multiline comment to even determine if nested comments
existed within it.  So while
I guess I don't mind support for nested comments, I think it is only
useful with fixed, short
comment delimiters, so I'd rather take it out if it saved even a few CPU
cycles, or just a little
lexing/parsing complexity.

Regarding overlapping comments, I think support for such a thing should
be considered a bug... I
don't understand what value it would have.  I think I'm willing to hear
some comments from someone
who has found such a feature useful, or even just had a specific wish
for such a thing.

With short fixed delimiters, overlapping comments couldn't really be
distinguished from nested
comments, except in the case of comments of different syntaxes.

I'd like to have the rule that multiline comments must start as the
first token on a line, and that
they are scanned only for their terminating token, which would remove
any possibility of
overlapping comments from consideration.

--
Glenn
=====
There  are two kinds of people, those
who finish  what they start,  and  so
on...                 -- Robert Byrne

____________NetZero Free Internet Access and Email_________
Download Now     http://www.netzero.net/download/index.html
Request a CDROM  1-800-333-3633
___________________________________________________________



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About