Skip to main content

write_poly

Function write_poly 

Source
pub fn write_poly(
    ty: PortType,
    v: Value,
    scratch: &mut [ScratchBuf],
    outputs: &mut [u64],
)
Expand description

A polymorphic return written by the node’s resolved output type: a scalar as its bits into outputs[0], a Ref2 kind into scratch[0] with its pair republished (axiom S3). The value must be the port type’s carrier: the graph colored the slot by the node’s resolved output type, and a value of another type would be read by every consumer as something it is not, where the interpreter would have carried it. A None has no slot form on a compiled engine (engines.md §3.3).

The comparison is with the carrier, not the port type, because a u32 or f32 value is a U64 in flight. Comparing with the port type refused every narrow integer and small float that reached a polymorphic node, on every compiled engine.