No declaration keyword
A name is created the same way it’s updated — there’s nolet:
The one assignment rule
name = value (typed or not) updates the nearest existing binding for
name in the enclosing scope chain. If none exists anywhere, it creates
one in the current (innermost) scope.global/nonlocal before a nested scope can
mutate an enclosing variable — miss it and you get UnboundLocalError.
Sense has one rule, no exception to remember:
local: get a genuinely new variable
Want a fresh binding even though an outer one of the same name exists?
That’s local:
local always creates in the current (innermost) scope. local name: Type = expr supports a type annotation, same as the untyped form.
Blocks are their own scope
if/while/for bodies, function calls, session bodies, and agent
bodies each get their own child scope. A variable first assigned inside
one, with no matching name in any enclosing scope, stays local to it:
set delegation and policy use the same scope chain
set delegation = <model> (see Model, Ask & Answer)
and policy: allow/deny <capability> (see Policy) resolve
through this exact mechanism — each scope has its own optional override,
found by walking up the parent chain, same as a variable lookup. Nothing
new to learn for those.Continue
Functions
Declaring, calling, closures, and typed parameters.
Control flow
if/else, while, for, break, continue.
