@@ -825,7 +825,7 @@ implementation provided by L<C<Any>|/type/Any> (which is involved in auto-vivifi
825
825
=head2 Methods to implement for positional subscripting
826
826
827
827
In order to make index-based subscripting via L<C<postcircumfix [ ]>|
828
- /routine/[ ] #postcircumfix_[_]> work for your custom type, you should
828
+ /language/operators #postcircumfix_[_]> work for your custom type, you should
829
829
implement at least C<elems>, C<AT-POS> and C<EXISTS-POS> - and optionally
830
830
others as detailed below.
831
831
@@ -835,7 +835,7 @@ others as detailed below.
835
835
836
836
Expected to return a number indicating how many subscriptable elements
837
837
there are in the object. May be called by users directly, and is also
838
- called by L<C<postcircumfix [ ]>|/routine/[ ] #postcircumfix_[_]> when
838
+ called by L<C<postcircumfix [ ]>|/language/operators #postcircumfix_[_]> when
839
839
indexing elements from the end, as in C<@foo[*-1]>.
840
840
841
841
If not implemented, your type will inherit the default implementation from
@@ -855,7 +855,7 @@ to avoid silently doing the wrong thing.
855
855
methods below), after jnthn's ongoing refactor is finished.
856
856
857
857
Expected to return the element at position C<$index>. This is what
858
- L<C<postcircumfix [ ]>|/routine/[ ] #postcircumfix_[_]> normally calls.
858
+ L<C<postcircumfix [ ]>|/language/operators #postcircumfix_[_]> normally calls.
859
859
860
860
If you want an element to be mutable (like they are for the built-in
861
861
L<C<Array>|/type/Array> type), you'll have to make sure to return it in the form of
@@ -872,7 +872,7 @@ to make that work; see the L<example|/language/subscripts#Custom_type_example>.
872
872
873
873
Expected to return a Bool indicating whether or not there is an element at
874
874
position C<$index>. This is what L<C<postcircumfix [ ]>|
875
- /routine/[ ] #postcircumfix_[_]> calls when invoked like C<@foo[42]:exists>.
875
+ /language/operators #postcircumfix_[_]> calls when invoked like C<@foo[42]:exists>.
876
876
877
877
What "existence" of an element means, is up to your type.
878
878
@@ -890,7 +890,7 @@ L<die|/routine/die>s, to avoid silently doing the wrong thing.
890
890
multi method DELETE-POS (::?CLASS:D: $index)
891
891
892
892
Expected to delete the element at position C<$index>, and return the value
893
- it had. This is what L<C<postcircumfix [ ]>|/routine/[ ] #postcircumfix_[_]>
893
+ it had. This is what L<C<postcircumfix [ ]>|/language/operators #postcircumfix_[_]>
894
894
calls when invoked like C<@foo[42]:delete>.
895
895
896
896
What "deleting" an element means, is up to your type.
@@ -1022,7 +1022,7 @@ say @a; # OUTPUT: «[1,2,3,4]»
1022
1022
=head2 Methods to implement for associative subscripting
1023
1023
1024
1024
In order to make key-based subscripting via L<C<postcircumfix { }>|
1025
- /routine/{ } #postcircumfix_{_}> work for your custom type, you should
1025
+ /language/operators #postcircumfix_{_}> work for your custom type, you should
1026
1026
implement at least C<AT-KEY> and C<EXISTS-KEY> - and optionally
1027
1027
others as detailed below.
1028
1028
@@ -1034,7 +1034,7 @@ others as detailed below.
1034
1034
multi method AT-KEY (::?CLASS:D: $key)
1035
1035
1036
1036
Expected to return the element associated with C<$key>. This is what
1037
- L<C<postcircumfix { }>|/routine/{ } #postcircumfix_{_}> normally calls.
1037
+ L<C<postcircumfix { }>|/language/operators #postcircumfix_{_}> normally calls.
1038
1038
1039
1039
If you want an element to be mutable (like they are for the built-in
1040
1040
L<C<Hash>|/type/Hash> type), you'll have to make sure to return it in the form of
@@ -1053,7 +1053,7 @@ to return non-container values directly.
1053
1053
multi method EXISTS-KEY (::?CLASS:D: $key)
1054
1054
1055
1055
Expected to return a Bool indicating whether or not there is an element
1056
- associated with C<$key>. This is what L<C<postcircumfix { }>|/routine/{ } #postcircumfix_{_}>
1056
+ associated with C<$key>. This is what L<C<postcircumfix { }>|/language/operators #postcircumfix_{_}>
1057
1057
calls when invoked like C<<%foo<aa>:exists>>.
1058
1058
1059
1059
What "existence" of an element means, is up to your type.
@@ -1072,7 +1072,7 @@ silently doing the wrong thing.
1072
1072
multi method DELETE-KEY (::?CLASS:D: $key)
1073
1073
1074
1074
Expected to delete the element associated with C<$key>, and return the
1075
- value it had. This is what L<C<postcircumfix { }>|/routine/{ } #postcircumfix_{_}> calls when invoked like
1075
+ value it had. This is what L<C<postcircumfix { }>|/language/operators #postcircumfix_{_}> calls when invoked like
1076
1076
C<<%foo<aa>:delete>>.
1077
1077
1078
1078
What "deleting" an element means, is up to your type - though it should
0 commit comments