From 1a6e507ccac2217c3a7483b5ffa8e72dc2e205d9 Mon Sep 17 00:00:00 2001 From: Stoned Elipot Date: Fri, 3 Jan 2020 13:35:26 +0100 Subject: [PATCH] Sync enum example with its (original?) intent ... At least as far as I understood it. Also, while here, drop unneeded parentheses in enum construction. --- doc/Language/typesystem.pod6 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/Language/typesystem.pod6 b/doc/Language/typesystem.pod6 index 4b8106d08..d4ec2b4aa 100644 --- a/doc/Language/typesystem.pod6 +++ b/doc/Language/typesystem.pod6 @@ -792,10 +792,10 @@ that have been defined. All of them turn the values into C, which may not be desirable. By treating the enum as a package, we can get a list of types for the keys. - enum E(); + enum E ; my @keys = E::.values; - say @keys.map: *.enums; - # OUTPUT: «(Map.new((one => 0, two => 1)) Map.new((one => 0, two => 1)))␤» + say @keys.map: *.perl; + # OUTPUT: «(E::one E::two)␤» With the use of B<()> parentheses, an enum can be defined using any arbitrary dynamically defined list. The list should consist of Pair