In Operators§
See primary documentation in context for infix =>
sub infix:«=>»(, Mu --> Pair)
Pair
constructor.
Constructs a Pair
object with the left-hand side as the key and the right-hand side as the value.
Note that the =>
operator is syntactically special-cased, in that it allows unquoted identifier on the left-hand side.
my = a => 1;say .key; # OUTPUT: «a»say .value; # OUTPUT: «1»
A Pair
within an argument list with an unquoted identifier on the left is interpreted as a named argument.
See the Terms language documentation for more ways to create Pair
objects.