{"id":"word--from","name":"from","owner":"yeho","package":"language","kind":"keyword","signature":"from","description":"Start a numeric range","context":"Use a range when you need an index or a predictable number of iterations.","parameters":[],"returns":"","members":[],"tags":["complete-program","cpu","keyword","loops","yeho"],"updated":"2026-09-09","source":{"repository":"yeho","path":"parser_loops.cpp parseForStatement; tests/compiler/kyber/range-loop-runtime/start.yh"},"status":"stable","notes":["< excludes the end; <= includes it.","The step is the next-value expression, such as i + 2."],"examples":[{"id":"complete","title":"Positive","description":"Use a range when you need an index or a predictable number of iterations.","code":"thing point\n{\n    int x\n    int y\n\n    point(int x, int y)\n    {\n        this.x = x\n        this.y = y\n    }\n\n    Sum() -> int\n    {\n        return this.x + this.y\n    }\n}\n\nAdd(int left, int right) -> int\n{\n    return left + right\n}\n\npoint value = point(2, 3)\nint total = 0\nfor i from 0 < 4\n{\n    total = total + i\n}\n\nint iterations = 0\nwhile iterations < 2\n{\n    iterations = iterations + 1\n}\n\nif value.Sum() == 5 and Add(total, iterations) == 8\n{\n    Console.Log(\"core-edition-ok\")\n}\nelse\n{\n    Console.Log(\"core-edition-failed\")\n}\n","manifest":"package = \"tests.coreEdition.positive\"\n","tags":["cpu","complete-program"],"verification":"type checked","run":"cpu-oracle","source":"tests/compiler/core-edition/positive/start.yh","sha256":"658c24b53e041479c84c3908c77cad8390cdaa6afba4f4bec9d01c3ece22d719","checked":"2026-09-09","diagnostic":"","observedOutput":null,"checkedBackend":null}],"searchTerms":[],"url":"https://demonhunterlabs.com/academy/api?item=word--from","json":"https://demonhunterlabs.com/reference/items/word--from.json","markdown":"https://demonhunterlabs.com/reference/text/word--from.md"}
