# from

Start a numeric range

Last updated: 2026-09-09

Package: language | Status: stable

Tags: complete-program, cpu, keyword, loops, yeho

Use a range when you need an index or a predictable number of iterations.

```yh
from
```


## Positive

Use a range when you need an index or a predictable number of iterations.

Verification: type checked

```yh
thing point
{
    int x
    int y

    point(int x, int y)
    {
        this.x = x
        this.y = y
    }

    Sum() -> int
    {
        return this.x + this.y
    }
}

Add(int left, int right) -> int
{
    return left + right
}

point value = point(2, 3)
int total = 0
for i from 0 < 4
{
    total = total + i
}

int iterations = 0
while iterations < 2
{
    iterations = iterations + 1
}

if value.Sum() == 5 and Add(total, iterations) == 8
{
    Console.Log("core-edition-ok")
}
else
{
    Console.Log("core-edition-failed")
}

```

Save this beside start.yh as project.mech:

```toml
package = "tests.coreEdition.positive"

```

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/word--from/complete --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


< excludes the end; <= includes it.

The step is the next-value expression, such as i + 2.

Source: yeho/parser_loops.cpp parseForStatement; tests/compiler/kyber/range-loop-runtime/start.yh

AI training permission: https://demonhunterlabs.com/ai-use
