shape
Nu shape fabric: DSL + Ref blueprints (3-tier matrix) + queries/commands.
Module nu.domains.shape.
Nu shape fabric: DSL + Ref blueprints (3-tier matrix) + queries/commands.
Shape,ShapeMeta,Slot,SlotDescriptor: the DSL.- 21 Ref blueprints for structural navigation and substrate extension (7 families x 3 tiers).
SetCmd,Erase: slot-level write commands.Load,Exists,Missing,Extract,AdvanceCursor: slot-level read queries.reroot/rerooter: splice the bare ref chains in a term under a new parent, so a snippet written without a mount point gets one.root_shape: which Shape a Ref chain is rooted at, for code handed a Ref as a location and building its own reads under it.
Reactive queries (OnChange / OnChildChange /
OnChildrenChange / OnDescendantsChange /
OnPrimitiveChange) live in nu.core.reactive -- one unified
interface for every substrate, reached through the shape Form mixins.
Modules
| Module | What |
|---|---|
nu.domains.shape.forms | Shape-domain Form chain. |
interactions
Module nu.domains.shape.interactions.
Shape fabric queries and commands: all shape interactions in one place.
| Name | Sort | Call | Meaning |
|---|---|---|---|
| AdvanceCursor | scalar_query | AdvanceCursor() | Read the next key after the cursor on an ordered view. |
| Erase | scalar_command | Erase() | Remove the slot-0 structured Ref from its fabric. |
| Exists | scalar_query | Exists() | Yield True if the slot-0 Ref's address is bound (value is not a sentinel). |
| Extract | scalar_query | Extract() | Materialise the full subtree at the slot-0 Ref via view.extract(). |
| Load | scalar_query | Load() | Yield the value at the slot-0 Ref; EMPTY if the address is unbound. |
| Missing | scalar_query | Missing() | Yield True if the slot-0 Ref's address is unbound (value is a sentinel). |
| PrimitiveSet | scalar_command | PrimitiveSet() | Write the slot-1 value to the slot-0 Ref via _primitive_write. |
| SetCmd | scalar_command | SetCmd() | Write the slot-1 value to the slot-0 structured Ref's address. |
refs.item
Module nu.domains.shape.refs.item.
ItemRef hierarchy: leaf Ref + Form mixin tiers.
| Name | Sort | Call | Meaning |
|---|---|---|---|
| ItemRef | ref | ItemRef(address, parent_ref=None, owner_shape=None) | Leaf Ref: single typed value, no child descent. |
| MutableItemRef | ref | MutableItemRef(address, parent_ref=None, owner_shape=None) | Mutable leaf Ref: single typed value with write/erase. |
| ReactiveItemRef | ref | ReactiveItemRef(address, parent_ref=None, owner_shape=None) | Reactive leaf Ref: single typed value with observation. |
refs.mapping
Module nu.domains.shape.refs.mapping.
MappingRef hierarchy: key-value container Ref + Form mixin tiers.
| Name | Sort | Call | Meaning |
|---|---|---|---|
| MappingRef | ref | MappingRef(address, parent_ref=None, owner_shape=None) | Key-value container Ref; ref[key] navigates to the value's child Ref. |
| MutableMappingRef | ref | MutableMappingRef(address, parent_ref=None, owner_shape=None) | Mutable key-value container Ref. |
| ReactiveMappingRef | ref | ReactiveMappingRef(address, parent_ref=None, owner_shape=None) | Reactive key-value container Ref. |
refs.sequence
Module nu.domains.shape.refs.sequence.
SequenceRef hierarchy: ordered container Ref + Form mixin tiers.
| Name | Sort | Call | Meaning |
|---|---|---|---|
| MutableSequenceRef | ref | MutableSequenceRef(address, parent_ref=None, owner_shape=None) | Mutable ordered container Ref. |
| ReactiveSequenceRef | ref | ReactiveSequenceRef(address, parent_ref=None, owner_shape=None) | Reactive ordered container Ref. |
| SequenceRef | ref | SequenceRef(address, parent_ref=None, owner_shape=None) | Ordered container Ref; ref[i] navigates to the element's child Ref. |
refs.set_
Module nu.domains.shape.refs.set_.
SetRef hierarchy: unordered unique-element container Ref + Form mixin tiers.
| Name | Sort | Call | Meaning |
|---|---|---|---|
| MutableSetRef | ref | MutableSetRef(address, parent_ref=None, owner_shape=None) | Mutable unordered unique-element container Ref. |
| ReactiveSetRef | ref | ReactiveSetRef(address, parent_ref=None, owner_shape=None) | Reactive unordered unique-element container Ref. |
| SetRef | ref | SetRef(address, parent_ref=None, owner_shape=None) | Unordered unique-element container Ref; no child descent. |
refs.shape
Module nu.domains.shape.refs.shape.
ShapeRef hierarchy: structured container Ref with named-slot navigation.
| Name | Sort | Call | Meaning |
|---|---|---|---|
| MutableShapeRef | ref | MutableShapeRef(address, shape_type, parent_ref=None, owner_shape=None) | Mutable structured container Ref. |
| ReactiveShapeRef | ref | ReactiveShapeRef(address, shape_type, parent_ref=None, owner_shape=None) | Reactive structured container Ref. |
| ShapeRef | ref | ShapeRef(address, shape_type, parent_ref=None, owner_shape=None) | Structured container Ref; slot navigation via attribute or bracket access. |
refs.shapes_mapping
Module nu.domains.shape.refs.shapes_mapping.
ShapesMappingRef hierarchy: mapping-of-shapes Ref + Form mixin tiers.
| Name | Sort | Call | Meaning |
|---|---|---|---|
| MutableShapesMappingRef | ref | MutableShapesMappingRef(address, item_shape_type, parent_ref=None, owner_shape=None) | Mutable mapping-of-shapes Ref; subscript returns MutableShapeRef. |
| ReactiveShapesMappingRef | ref | ReactiveShapesMappingRef(address, item_shape_type, parent_ref=None, owner_shape=None) | Reactive mapping-of-shapes Ref; subscript returns ReactiveShapeRef. |
| ShapesMappingRef | ref | ShapesMappingRef(address, item_shape_type, parent_ref=None, owner_shape=None) | Mapping-of-shapes Ref; subscript descent returns a ShapeRef. |
refs.shapes_sequence
Module nu.domains.shape.refs.shapes_sequence.
ShapesSequenceRef hierarchy: sequence-of-shapes Ref + Form mixin tiers.
| Name | Sort | Call | Meaning |
|---|---|---|---|
| MutableShapesSequenceRef | ref | MutableShapesSequenceRef(address, item_shape_type, parent_ref=None, owner_shape=None) | Mutable sequence-of-shapes Ref; subscript returns MutableShapeRef. |
| ReactiveShapesSequenceRef | ref | ReactiveShapesSequenceRef(address, item_shape_type, parent_ref=None, owner_shape=None) | Reactive sequence-of-shapes Ref; subscript returns ReactiveShapeRef. |
| ShapesSequenceRef | ref | ShapesSequenceRef(address, item_shape_type, parent_ref=None, owner_shape=None) | Sequence-of-shapes Ref; subscript descent returns a ShapeRef. |
rewrite
Module nu.domains.shape.rewrite.
Re-rooting: splice every bare ref chain in a tree under a new parent.
| Name | Call | Meaning |
|---|---|---|
| reroot | shape.reroot(root, under, rooted=None) | Rewrite root so every bare ref chain in it hangs off under. |
| rerooter | shape.rerooter(under, rooted=None) | reroot with its policy fixed, as a plain Nu -> Nu transform. |
refs.base
Module nu.domains.shape.refs.base.
StructuredRef: abstract base for all shape-fabric Refs.
| Name | Call | Meaning |
|---|---|---|
| root_shape | shape.root_shape(ref) | The Shape class a Ref chain is rooted at. |