πŸ“˜ Cross meta-operator X in Perl 6

πŸ“˜ Cross meta-operator X in Raku

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


The cross meta-operator prefix, X, applies an operation to all the possible combinations of the elements of the operands that are treated in list context. The result of the cross-operation is also a list.

Here is an example that prints the coordinates for all the cells of a chess board:

say 'a'..'h' X~ 1..8;

One thought on “πŸ“˜ Cross meta-operator X in Perl 6”

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