Both pugs and rakudo agree on this one:

21:44 <@moritz_> perl6: my (@a, @b); @a.push(@b.pop); say @a.elems
21:44 < p6eval> ..pugs, rakudo 34399: OUTPUT«1␤»

pop'ping from an empty array returns an undef, which is then pushed onto @a.

Wouldn't it be nice of @empty_list.pop (or .unshift) would return a Nil
instead, so that in list context this is the empty array, and the
operation @a.push(@b.pop) would always preserve (@a.elems + @b.elems)?

Cheers,
Moritz
(and a happy new year to all Perl 6 hackers, designers, fans and followers).

Reply via email to