Skip to main content

Module iter

Module iter 

Source
Expand description

Lazy iterator protocol for the Harn VM.

VmIter is the backing enum for VmValue::Iter. It’s a single-pass, fused iterator; once next returns None the variant is replaced with Exhausted. Step (a) only introduces source variants (Vec, Dict, Chars, Gen, Chan, Exhausted) and wires them into the for-loop driver. Combinator variants (Map, Filter, Take, …) and sink builtins land in later steps per the plan.

Enums§

VmIter
Backing enum for VmValue::Iter. See module docs.

Functions§

drain
Fully consume an iter handle into a Vec of values.
iter_from_value
Convenience: wrap a source value into a VmValue::Iter. Used by the iter() builtin and by combinator/sink implementations in later steps.
next_handle
Advance a handle without holding a RefCell borrow across the await.