A LET binds a name to the result of a single expression — reactive in a body, a constant at module or type level.
The grammar of a single LET line:
A LET keyword can live at the Root, or inside FUNCTION , REVERSE , WITH , MODULE , and TYPE keywords.
At the program's run root, a LET is a Root binding in the code that actually runs.
The type comes first, then the name, then the expression. Change radius and both bindings settle again, in order.
A derived binding in the function body, recomputed reactively as its inputs change.
Each LET names one step of the body, and the compiler recomputes a binding only when a value it read has changed.
Part of a write-back body, preparing the value that the closing SET pushes back.
The LET bindings compute from the incoming value exactly as in a forward block, preparing what the final SET writes back.
A binding in a WITH block, computed with the swapped module implementation in place.
The LET runs under the override, so every name it reaches for as Logic is served by the replacement until the block ends.
At module level a LET declares a named constant — a fixed value in the module's namespace, not running code.
The expression must be a constant — a literal, or a type constructor applied to literals — so the value is fixed once, with no inputs or reactive dependencies. It is reached through the module's name, as Palette.Brand .
A type doubles as a namespace, so a LET inside it declares a constant reached through the type's name.
The constant follows the type's FIELD lines and is named through the type — here Colour.RGB.Black . As at module level, its value must be a constant expression.
A LET is a leaf: it takes a type, a name, and a single expression on the right of the = . In a body that is normally one call with plain-value arguments, recomputed reactively; at MODULE or TYPE level it must be a constant — a literal or a type constructor applied to literals. Either way it opens no indented lines and contains no further keywords.
The same example, rendered to each target.
A changeable cell is a STATE ; a function returns its last value with a trailing = (see FUNCTION ), and a REVERSE may use LET lines before it writes back. The reactive model is covered in Reactive . Back to the language .