πŸ“˜ 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

Your email address will not be published. Required fields are marked *

Retype the CAPTCHA code from the image
Change the CAPTCHA codeSpeak the CAPTCHA code