# Yielding functions

yield can produce a sequence of values from one function, but the final lowering operation is deliberately rejected by Kyber today.

Last updated: 2026-09-09

Package: language | Status: generated-cpp-only

Tags: boundaries, cpu, language, yeho, yield

Return a concrete list in Kyber-ready code. Use yield only in the explicit comparison lane while studying the future generator contract.

```yh
yield expression
```


## Oracle route

Return a concrete list in Kyber-ready code. Use yield only in the explicit comparison lane while studying the future generator contract.

Verification: type checked

```yh
Collect() -> list of int
{
    yield 4
    yield 7
}

list of int values = Collect()

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.language__yielding_functions"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/language--yielding-functions/complete-0 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## Kyber-ready alternative

Return a concrete list in Kyber-ready code. Use yield only in the explicit comparison lane while studying the future generator contract.

Verification: type checked

```yh
Collect() -> list of int
{
    return [4, 7]
}

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.language__yielding_functions"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/language--yielding-functions/complete-1 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


Forge records yield as a distinct semantic operation.

The generated C++ comparison fixture executes it; Kyber rejects the final-deferred operation explicitly.

Source: yeho/tests/compiler/forge-contract/yield/start.yh; docs/tooling/forge-v2-contract.md

AI training permission: https://demonhunterlabs.com/ai-use
