syntax ->

Documentation for syntax -> assembled from the following types:

language documentation Functions

From Functions

(Functions) syntax ->

Whenever you see something like { $_ + 42 }, -> $a, $b { $a ** $b }, or { $^text.indent($:spaces) }, that's Block syntax. It's used after every if, for, while, etc.

for 1234 -> $a$b {
    say $a ~ $b;
}
# OUTPUT: «12␤34␤» 

They can also be used on their own as anonymous blocks of code.

say { $^a ** 2 + $^b ** 2}(34# OUTPUT: «25␤» 

For block syntax details, see the documentation for the Block type.