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 1, 2, 3, 4 -> ,# OUTPUT: «1234»
They can also be used on their own as anonymous blocks of code.
say (3, 4) # OUTPUT: «25»
For block syntax details, see the documentation for the Block type.