Documentation for infix ,
assembled from the following pages:
Language documentation: Operators §
From Operators
(Operators) infix , §
sub infix:<,>(* --> List) is assoc<list>
Constructs a higher-order Cool from its arguments.
my = :god('Þor'), ['is',"mighty"];say ; # OUTPUT: «[god => Þor [is mighty]]» my = :god('Þor'), :is("mighty");say .raku; # OUTPUT: «{:god("Þor"), :is("mighty")}» my = :11a, :22b;say %(, :33x); # OUTPUT: «{a => 11, b => 22, x => 33}»
In the first case it returns a List, in the second case, since the arguments are Pairs, it builds a Hash.
It can also be used for constructing variables from other variables, collating elements of different types, in this case a Hash and a Pair:
my = , :wields("hammer");say ; # OUTPUT: «{god => Þor, is => mighty, wields => hammer}»
The comma is also used syntactically as the separator of arguments in calls.