Expand description
The Shape protocol: the one shared engine for matching and binding.
Shape is a first-class kernel protocol used across parsing, checking, binding, dispatch, macro syntax, codec grammar, and overload selection; the kernel defines the protocol and the match/binding contracts, while concrete shapes are implemented by the libraries.
Structs§
- Match
Score - A match quality score used to rank shapes during overload selection.
- Shape
Bindings - Captures produced by a successful match: named values and named exprs.
- Shape
Doc - Human-facing description of a
Shape: a name plus optional detail lines. - Shape
Match - The outcome of checking a value or expr against a
Shape. - Shape
Match Object - Object wrapper exposing a
ShapeMatchto the runtime as a table.
Enums§
- Expr
Kind - A coarse classifier over
Exprvariants, used by grammar shapes. - Shape
Call Target - What a
call_shapeinvocation checks: a runtime value or an expr.
Traits§
- Shape
- The one shared engine for matching and binding across the runtime.
Functions§
- call_
shape - Run a shape against a
ShapeCallTargetand return the match as a value. - shape_
is_ subshape_ of - Decide whether
childis a subshape ofparent. - shape_
match_ value - Wrap a
ShapeMatchas an opaqueShapeMatchObjectruntime value.