Expand description
Lexical and runtime context shared across evaluation steps.
Scope is the single carrier of evaluator state: it walks down through the
AST, threads imported bindings, anchors &root/&sibling lookups, and
holds the lazy-evaluation thunk table. It is wrapped in Arc everywhere so
children can be derived cheaply via Scope::child and friends.
Structs§
- List
Context - Iteration context for
&prev/&next/&indexreferences inside a list. - RootRef
- Anchor for
&rootlookups in aScope. - Scope
- Single environment frame. Cheap to derive (every field is either
CloneorArc-shared) and wrapped inArc<Scope>at every call site so backtracking throughparentstays copy-free. - Thunk
- A lazily-evaluated dict entry. The first access through
Evaluator::force_thunkparses + evaluatesnodeagainstscopeand caches the result invalue; later accesses return the cached value.
Type Aliases§
- Locals
- Type alias for the bindings table. Wrapped in
Mutexso concurrent host evaluators sharing aScopeacross threads stay safe; the innerHashMapstarts empty (zero-capacity, no heap allocation) and only grows when something actually writes a binding. - Thunks
- Type alias for the thunks table — same shape as
Locals.