Note: This document is a living document and may not represent the current implementation of Flux.

A block is a possibly empty sequence of statements within matching braces ({}).

Block = "{" StatementList "} .
StatementList = { Statement } .

In addition to explicit blocks in the source code, there are implicit blocks:

  1. The options block is the top-level block for all Flux programs. All option declarations are contained in this block.
  2. The universe block encompasses all Flux source text aside from option statements. It is nested directly inside of the options block.
  3. Each package has a package block containing all Flux source text for that package.
  4. Each file has a file block containing all Flux source text in that file.
  5. Each function literal has its own function block even if not explicitly declared.

Blocks nest and influence scoping.

This documentation is open source. See a typo? Please, open an issue.

Need help getting up and running? Get Support