When I execute the following statement in the Perl6 REPL:
my $var = 1, 2, 3;
it prints:
(1 2 3)
This seems curious to me, because $var
is actually assigned a single integer (i.e. $var.WHAT
returns (Int)
), rather than a List
of Int
s.
I take it that the reason that an Int
is assigned is the higher precedence of the item assignment operator (=
) relative to the comma operator (,
), which leaves the ,2,3
in sink context. But why does the REPL display a List
of Int
s? And what does the REPL in general display after the execution of a statement?