📘 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;

Leave a Reply