Skip to content

Commit 7676e00

Browse files
committed
Moving 'enum-pair' definitions to its real place, Enumeration
1 parent 1cdd59e commit 7676e00

File tree

1 file changed

+1
-38
lines changed

1 file changed

+1
-38
lines changed

doc/Language/typesystem.pod6

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -775,48 +775,11 @@ Defined as:
775775
776776
method enums()
777777
778-
Returns the list of enum-pairs. Works both on the enum type and any key.
778+
Returns the list of enum-pairs.
779779
780780
enum Mass ( mg => 1/1000, g => 1/1, kg => 1000/1 );
781781
say Mass.enums; # OUTPUT: «{g => 1, kg => 1000, mg => 0.001}␤»
782782
783-
=head4 method key
784-
785-
Returns the key of an enum-pair.
786-
787-
=for code :preamble<<enum Mass<g> >>
788-
say g.key; # OUTPUT: «g␤»
789-
790-
=head4 method value
791-
792-
Returns the value of an enum-pair.
793-
794-
=for code :preamble<<enum Mass<g> >>
795-
say g.value; # OUTPUT: «1␤»
796-
797-
=head4 method pair
798-
799-
Defined as:
800-
801-
=for code
802-
method pair(::?CLASS:D:)
803-
804-
Returns the enum-pair as a C<Pair>.
805-
806-
=for code :preamble<<enum Mass<g> >>
807-
say g.pair; # OUTPUT: «g => 1␤»
808-
809-
=head4 method kv
810-
811-
Defined as:
812-
813-
=for code
814-
multi method kv(::?CLASS:D:)
815-
816-
Returns a list with key and value of the enum-pair.
817-
818-
=for code :preamble<<enum Mass<g> >>
819-
say g.kv; # OUTPUT: «(g 1)␤»
820783
821784
=head3 Coercion
822785

0 commit comments

Comments
 (0)