Skip to content

Commit

Permalink
Sync enum example with its (original?) intent
Browse files Browse the repository at this point in the history
... At least as far as I understood it.
Also, while here, drop unneeded parentheses in enum construction.
  • Loading branch information
stoned committed Jan 3, 2020
1 parent bdae66f commit 1a6e507
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/Language/typesystem.pod6
Expand Up @@ -792,10 +792,10 @@ that have been defined. All of them turn the values into C<Str>, which may not
be desirable. By treating the enum as a package, we can get a list of types for
the keys.
enum E(<one two>);
enum E <one two>;
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
Expand Down

0 comments on commit 1a6e507

Please sign in to comment.