You can declare a list of variables and assign them some value in Perl 6
my ($a, $b) = 33,44 # $a will be 33 and $b 44
However, if you try to assign the value following the declaration of the variable the values will be silently dropped
my ($a = 44, $b = 33);
say $a, $b; #OUTPUT: «(Any)(Any)»
It gets weirder from there, since
my ($a = 44, $b);
fails with:
===SORRY!=== Error while compiling /tmp/G7JgLMe1Wq
Cannot put required parameter $b after optional parameters
and
my ($a, $b = 33);
will have the same result as assigning any of them together.
This behavior is confusing to me. Should it issue a warning? Should the first expression also yield the same error about optional parameters? Should we document it as a trap? All of the above?