diff options
Diffstat (limited to 'docs/integers.md')
| -rw-r--r-- | docs/integers.md | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/docs/integers.md b/docs/integers.md index b6600314..84f33414 100644 --- a/docs/integers.md +++ b/docs/integers.md @@ -257,6 +257,37 @@ The octal string representation of the integer. --- +### `onward` + +**Description:** +Return an iterator that counts infinitely from the starting integer (with an +optional step size). + +**Signature:** +```tomo +func onward(first: Int, step: Int = 1 -> Text) +``` + +**Parameters:** + +- `first`: The starting integer. +- `step`: The increment step size (default: 1). + +**Returns:** +An iterator function that counts onward from the starting integer. + +**Example:** +```tomo +nums := &[:Int] +for i in 5:onward(): + nums:insert(i) + stop if i == 10 +>> nums[] += [5, 6, 7, 8, 9, 10] +``` + +--- + ### `parse` **Description:** |
