Skip to content

Commit 741f52b

Browse files
committed
doc anonymous enums
1 parent 28989a3 commit 741f52b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

doc/Language/typesystem.pod

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,16 @@ A different starting value can be provided.
6464
enum Numbers «:one(1) two three four»;
6565
dd Numbers.enums; # OUTPUT«{:four(4), :one(1), :three(3), :two(2)}␤»
6666
67+
68+
Enums can be anonymous. They will be no type created, resulting in a lack of
69+
introspectiveness. The returned object is of type C<Map>.
70+
71+
my $e = enum <one two three>;
72+
say two; # OUTPUT«two()(Hash)␤»
73+
say one.WHAT; # OUTPUT«()␤»
74+
say $e.WHAT; # OUTPUT«(Hash)␤»
75+
76+
6777
=head3 Methods
6878
6979
=head4 method enums

0 commit comments

Comments
 (0)