📘 Cross meta-operator X in Perl 6

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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s