routine enums
1 | language documentation Type system |
1.1 | (Type system) method enums |
2 | enum Bool |
2.1 | (Bool) routine enums |
3 | role Enumeration |
3.1 | (Enumeration) method enums |
Documentation for routine enums
assembled from the following types:
language documentation Type system
From Type system
(Type system) method enums
Defined as:
method enums()
Returns the list of enum-pairs.
( mg => 1/1000, g => 1/1, kg => 1000/1 );say Mass.enums; # OUTPUT: «{g => 1, kg => 1000, mg => 0.001}»
enum Bool
From Bool
(Bool) routine enums
method enums(--> Hash)
Returns a Hash of enum-pairs. Works on both the Bool
type and any key.
say Bool.enums; # OUTPUT: «{False => 0, True => 1}»say False.enums; # OUTPUT: «{False => 0, True => 1}»
role Enumeration
From Enumeration
(Enumeration) method enums
Defined as:
method enums()
Returns a Map of enum values. Works both on the enum type and any key.
( mg => 1/1000, g => 1/1, kg => 1000/1 );say Mass.enums; # OUTPUT: «Map.new((g => 1, kg => 1000, mg => 0.001))»say g.enums; # OUTPUT: «Map.new((g => 1, kg => 1000, mg => 0.001))»