File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -974,14 +974,15 @@ Defined as:
974
974
multi method antipairs(Any:U:)
975
975
multi method antipairs(Any:D:)
976
976
977
- Converts the invocant to a L < List|/type/List > via the C < list > method and returns
978
- the result of L < List.antipairs|/type/List#routine_antipairs > on it. Returns an
979
- empty L < List|/type/List > if the invocant is undefined:
977
+ Returns an
978
+ empty L < List|/type/List > if the invocant is a type object
980
979
981
- my $a;
982
- say $a.antipairs; # OUTPUT: «()»
983
- $a = Any.new;
984
- say $a.antipairs; # OUTPUT: «(Any.new => 0)»
980
+ Range.antipairs.say; # OUTPUT: «()»
981
+
982
+ If it's a value object, it returns the inverted list of pairs after converting
983
+ it to a list of pairs; the values will become keys and the other way round.
984
+
985
+ %(s => 1, t=> 2, u => 3).antipairs.say ;# OUTPUT: «(2 => t 1 => s 3 => u)»
985
986
986
987
= head2 method invert
987
988
You can’t perform that action at this time.
0 commit comments