📘 List repetition operator xx in Perl 6

📘 List repetition operator xx in Raku

N. B. Perl 6 has been renamed to Raku. Click to read more.


xx repeats the list the given number of times.

say (1, -1) xx 2; # ((1 -1) (1 -1))

Like the string x operator, the xx operator returns an empty list if the number of repetitions is zero or negative.

Leave a Reply