Expand description
Builds complete-shape templates without parsing source text.
Emitters return fresh segments; they never execute expressions during definition checking. Each live factory creates fresh mutable execution frames. Immutable definitions and intentionally shared host inputs may be captured by emitters.
use adam_lang::{CompositionBuilder, ParsedSheet, TypeRegistry};
use adam_lang::type_registry::TypeShape;
use std::any::TypeId;
let types = TypeRegistry::new();
let shape = TypeShape::Named(TypeId::of::<i32>());
let mut builder = CompositionBuilder::new(types.clone());
builder.parameter("x", shape.clone())?;
let template = builder.finish()?;
let mut destination = ParsedSheet::new();
let x = destination.add_cell(3i32);
destination.register_cell("x", x, shape, &types)?;
template.instantiate(&mut destination, &[("x", x)])?;Structs§
- Authored
Item - Retains one authored node and its native slots without expanding included definitions.
- Cell
Origin - Maps one local declaration or bound formal to its live occurrence.
- Cell
Slot - Retains a native local handle and its complete declared shape.
- Composition
Builder - Builds shape-checked recipes by delegating every graph operation to Adam.
- Instance
Origin - Retains one direct invocation’s flat occurrence records after template drop.
- Method
Recipe - Owns a repeatable native method with full input and output shapes.
- Occurrence
Origin - Retains one occurrence using parent links, never copied full invocation paths.
- Typed
Template - Owns a reusable native definition, complete formal/local shapes and source metadata.
Enums§
- Authored
Role - Classifies a local authored record without guessing from label text or output count.