Documentation for method antipair assembled from the following pages:

Class: Pair §

From Pair

(Pair) method antipair §

Defined as:

method antipair(Pair:D: --> Pair:D)

Returns a new Pair object with key and value exchanged.

my $p = (=> 'Raku').antipair;
say $p.key;         # OUTPUT: «Raku␤» 
say $p.value;       # OUTPUT: «d␤»