Glenn Linderman wrote:
>    $foo = $a + $b #< can this be an in-line comment?  ># + $c * $d;
>
> Note that with this scheme it would be possible to allow in-line comments
to be
> multi-line comments, or possible to prevent that.  I'd vote in favor of
keeping
> in-line comments on a single line.
>
> Note that with this scheme it would be possible to allow multi-line
comments to
> start in the middle of a line, or possible to prevent that.  I'd vote in
favor of
> making them start as the first thing on the line.

This seems like an acceptable variation on what has been suggested so far. I
deally one would be able to safely block comment any large section of a Perl
6 script and not worry about any other block comments within (the outermost
block comment takes precedence).

So this should work in Perl 6

code here;
#<
    # this is a single line comment
    $foo = $a + $b #< here's an in-line comment ># + $c * $d;
>#
more code here;

It is however, also necessary to avoid accidental collision with single line
comments or other perl syntax. For example this example (valid in perl5)
could confuse a compiler looking for block comments. Don't see anyway around
this sort of thing though.

print qq#<i>some html here</i>#;

--Michael

Reply via email to