aboutsummaryrefslogtreecommitdiff
path: root/man/man3/tomo-Int.onward.3
blob: ba83e8e2fa4d416d72e457c7f033a76fdd1a9c04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'\" t
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
.TH Int.onward 3 2025-09-06 "Tomo man-pages"
.SH NAME
Int.onward \- iterate from a number onward
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI Int.onward\ :\ func(first:\ Int,\ step:\ Int\ =\ 1\ ->\ Text)
.fi
.SH DESCRIPTION
Return an iterator that counts infinitely from the starting integer (with an optional step size).


.SH ARGUMENTS

.TS
allbox;
lb lb lbx lb
l l l l.
Name	Type	Description	Default
first	Int	The starting integer. 	-
step	Int	The increment step size. 	1
.TE
.SH RETURN
An iterator function that counts onward from the starting integer.

.SH EXAMPLES
.EX
nums : &[Int] = &[]
for i in (5).onward()
nums.insert(i)
stop if i == 10
>> nums[]
= [5, 6, 7, 8, 9, 10]
.EE