📘 List creation operator , in Perl 6

, creates a List object. Note that this operator, as a few mentioned above, can be chained to accept more than two operands.

my $what = (1, 2, 3);
say $what.WHAT; # (List)

The comma is also used as a separator of parameters passed to the subroutine.

To create an empty list, use a pair of parentheses ().

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