πŸ“˜ List creation operator , in Perl 6

πŸ“˜ List creation operator , in Raku

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


, 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

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