This raku documentation page says operator ,=
is supposed to concatenate
the contents of the variable on the left hand side and the expression on the right hand side
in a class-dependent way. The documentation also provides an example with a Hash
variable:
my %a = :11a, :22b;
%a ,= :33x;
say %a # OUTPUT: «{a => 11, b => 22, x => 33}»
This works for me, but when I try to do the same for an Array
something confusing happens:
my @a = 1, 2;
@a ,= 3;
say @a
And the output is something like (\Array_94393785458840 = [Array_94393785458840 3])
. I would expect however the result be [1, 2, 3]
.
My question is: Is this the expected behavior? And if so, what is the purpose of such an operation?