Perl6之一 - 注释 (obsolete)

sunnavy
2006-11-23 03:39:32 +0000
newer version is here

注释等同于空白(whitespace).

Perl6增加了两种注释:

  1. 内嵌注释(embedded comments):

'#'后跟一对brackets

e.g.

 say #( I'm a comment ) "howdy world"
 say #[ I am another comment] "howdy world"
  1. 块注释(block comments):

和内嵌注释类似,不同的是#{, #}之类的需要在行首。它是面向行的(line-oriented),而非如内嵌注释般是面向字符的(character-oriented)

e.g.

 #{
 block comments
 #}