Generators are Keikaku’s centerpiece, defined with sequence. Execution pauses at each yield and resumes when the caller calls proceed(gen). The documented counter(start) generator yields an incrementing value on each proceed, and numbers(max) is consumed directly by a cycle through loop. Beyond basic lazy iteration, the system provides delegation via delegate, which yields all values from another iterable inline: a maintask that yields "start", delegates subtask(), then yields "end" produces start, a, b, end. delegate accepts both generators and lists, generalizing composition.
Lazy sequences also have a concise inline form: generator expressions in parentheses, (x * x for x through [1,2,3,4,5]), with an optional where filter, (x for x through [1..6] where x % 2 == 0). These reuse the through iteration keyword from the loop forms, keeping the surface coherent, and provide on-demand data processing without writing a full sequence. The generator system is thus three-tiered: expressions for concise lazy sequences, sequence for full generators, and delegation for composing them.
REGAAN R