Skip to content

Commit a27516d

Browse files
committed
doc colon pair as part of identifier
1 parent caa99e1 commit a27516d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

doc/Language/syntax.pod6

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,16 @@ or automatically created packages.
185185
my Int $Foo::Bar::buzz = 42;
186186
dd $Foo::Bar::buzz; # OUTPUT«Int $v = 42␤»
187187
188+
Identifiers can contain colon pairs. The entire colon pair becomes part of the
189+
name of the identifier.
190+
191+
my $foo:bar = 1;
192+
my $foo:bar<2> = 2;
193+
dd MY::.keys;
194+
# OUTPUT«("\$=pod", "!UNIT_MARKER", "EXPORT", "\$_", "\$!", "::?PACKAGE",
195+
# "GLOBALish", "\$¢", "\$=finish", "\$/", "\$foo:bar<1>", "\$foo:bar<2>",
196+
# "\$?PACKAGE").Seq␤»
197+
188198
=head1 Statements and Expressions
189199
190200
Perl 6 programs are made of lists of statements. A special case of a statement

0 commit comments

Comments
 (0)