Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

multiline comments

30 views
Skip to first unread message

Alfie John

unread,
Oct 12, 2005, 1:28:01 AM10/12/05
to perl6-l...@perl.org
Hi (),

This is probably a stupid question, but I can't find anything from
google:

Does Perl6 support multiline comments?

Alfie John

Luke Palmer

unread,
Oct 12, 2005, 1:33:20 AM10/12/05
to Alfie John, perl6-l...@perl.org
On 10/11/05, Alfie John <alfi...@acm.org> wrote:
> Does Perl6 support multiline comments?

Yes, in the form of pod blocks.

=begin comment
=end comment

They nest, too.

Luke

Alfie John

unread,
Oct 12, 2005, 2:28:51 AM10/12/05
to Mark A.Biggar, perl6-l...@perl.org

On 12/10/2005, at 4:18 PM, Mark A. Biggar wrote:

> Briefly, No and kind of.
>
> Standard Perl 6 comments are just like those in Perl 5. A '#'
> starts a comment that is terminated by the end of line. But, both
> Perl 5 and 6 are intended to support the POD system of embedded
> documentation (for the 'kind of'.) Of course the grammar is planed
> to be dynamically modifiable so a Perl module could theoriticaly
> declare it own special multi-line comment system.
>
> --
> ma...@biggar.org
> mark.a...@comcast.net
>

So, my question now is will the Perl6 perldoc be extended to allow
filters to be run so that these "theoretical multi-line comment
systems" will be run before spitting out to STDOUT?

Alfie

Alfie John

unread,
Oct 12, 2005, 2:09:37 AM10/12/05
to Luke Palmer, perl6-l...@perl.org

But does that then break my lovely formatted pod like it does in Perl5?

Alfie

Mark A. Biggar

unread,
Oct 12, 2005, 2:18:44 AM10/12/05
to Alfie John, perl6-l...@perl.org

Briefly, No and kind of.

Luke Palmer

unread,
Oct 12, 2005, 2:54:24 AM10/12/05
to Alfie John, perl6-l...@perl.org
On 10/12/05, Alfie John <alfi...@acm.org> wrote:
> On 12/10/2005, at 3:33 PM, Luke Palmer wrote:
> > =begin comment
> > =end comment

>
> But does that then break my lovely formatted pod like it does in Perl5?

Try this:

% cat > dosomething.pl
=head1 TITLE

Thingy - do something

=head1 DESCRIPTION

=over

=item * do_something()

does something

=cut

=begin comment

Commented out code.

=end comment

=cut

=item * do_something_else()

does something different from C<do_something>.

=back

=cut
^D

% perldoc dosomething.pl

# note the lack of the string "Commented out code"

So it worked in Perl 5, too. It was just kind of a pain because you
had to put a "=cut" after the "=end", and because you had to put
paragraph spaces between everything. We're getting rid of both of
those restrictions.

Luke

Juerd

unread,
Oct 12, 2005, 5:45:07 AM10/12/05
to perl6-l...@perl.org
Alfie John skribis 2005-10-12 15:28 (+1000):

> Does Perl6 support multiline comments?

All incarnations of Perl have allowed us to begin multiple subsequent
lines with the comment glyph '#'. I am sure Perl 6 will not break this
tradition.


Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html

Alfie John

unread,
Oct 12, 2005, 6:25:36 PM10/12/05
to Luke Palmer, perl6-l...@perl.org
>
> It was just kind of a pain because you
> had to put a "=cut" after the "=end", and because you had to put
> paragraph spaces between everything. We're getting rid of both of
> those restrictions.

Excellent! That's what was really bugging me. I'm really glad that is
changing :)

Thanks,
Alfie

0 new messages