Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: [Perl 6]: Small discoveries VII, Flattening

by Anonymous Monk
on Oct 31, 2017 at 16:51 UTC ( [id://1202452]=note: print w/replies, xml ) Need Help??


in reply to Re^2: [Perl 6]: Small discoveries VII, Flattening
in thread [Perl 6]: Small discoveries VII, Flattening

Parens don't build lists in Perl6, commas do:
my @a := 1,2; say @a.^name; #List my @b := 1,; say @b.^name; #List
Parens are usually needed because of precedence when embedding the List into another expression. The comma does have another meaning: it's the separator in argument lists.

Replies are listed 'Best First'.
Re^4: [Perl 6]: Small discoveries VII, Flattening
by Anonymous Monk on Oct 31, 2017 at 17:08 UTC
    > my $x = 1,2; say $x 1 > my $y = (1,2); say $y (1 2)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1202452]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-20 15:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found