Course of Raku / Essentials

Code blocks

Code blocks are fragments of your program enclosed in a pair of curly braces: { and }. They group a series of statements that work together as a kind of one big statement. We will see many use cases in the further sections.

    say 'Hello, World!';

The presence of a code block in this program does not add much sense, but code blocks are quite useful in other situations, which we’ll cover very soon.

But first, let us examine the concept of scope.

Course navigation

Ranges / Matching against a range   |   Lexical scope