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

Re: RFC: multiline comments

Thread Previous | Thread Next
From:
Michael Mathews
Date:
August 3, 2000 12:05
Subject:
Re: RFC: multiline comments
Message ID:
02dc01bffd7d$ee1276b0$af0c0a0a@ny.oxygen.com
Glenn Linderman said:
> And while the existing q.() operators are typically used to surround
> fairly short blocks of text, with controlled content, the desire to
> comment out blocks of existing code with a multi-line comment facility
> has different goals, that are hard to meet with a single character
> delimiter, especially a paired one that results in scanning of the
> internal content for consistent usage of the delimiter.

Yes! this exactly the problem that I think *any* function-based proposal
will suffer, namely: function arguments have single-character delimiters,
and that single-character must not appear unescaped within the argument
itself.

Therefore the idea of using a comment function fails in the very important
goal of making it easy to comment large chunks of arbitrary perl code.

Unless anyone can prove otherwise I would say we should consider that a dead
issue.


> A multi-character delimiter seems required to me to make it easy to
> identify a delimiter which can be safely used.  One very Perl-ish
> technique for multi-character delimiters is

> <<END_OF_TEXT
>
> stuff
>
>
> END_OF_TEXT
>
> Together with the very Perl-ish technique for comments (the '#'
> character) this leads very obviously to:
>
> #<<END_OF_TEXT
>
> comment stuff
>
> END_OF_TEXT
>

I like this a lot. Any idea how this could work inline? or would you prefer
not to have fully inline comments?

--Michael


Thread Previous | Thread Next


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