klyn.collections.Generator.Generator
constructor

    public native Generator(start as T, stop as T, delta as T) throws ValueError

Description

Creates an immutable generated sequence from `start` to `stop`.

This constructor is intentionally native because the compiler/runtime iterate generators through an internal contiguous storage path. The storage remains private to the runtime: `Generator<T>` does not expose collection mutation or random-access APIs.

Parameters

- start First generated value.
- stop Exclusive bound.
- delta Step between two generated values. Must not be `0`.

Throws

- ValueError if `delta == 0`.

Example

    values = Generator<Int>(0, 3, 1)
    for value in values:
    print(value)