per
Translation status: ภาษาไทย reader-locale proof. Code fences render through the th-TH pipeline; prose is canonical Latin.
Sets the step for a range.
Syntax: <range> per <expression>
Category#
range
Related#
Examples#
radix/corpus/per/per.fab (canonical · keyword)#
Sets the step for a range.
# =============================================================================
# per — Sets the step for a range.
# =============================================================================
#
# What this teaches:
# • Range stepping — `per <expr>` after a range specifies the increment between iterations.
# • Custom step sizes — Unlike the default step of 1, `per 2` iterates over even numbers only.
#
# Common mistakes:
# • Confusing `per` (range step) with `perge` (continue) — they are unrelated keywords.
#
# See also: ante, usque
# =============================================================================
# per — step size for range iteration
#
# itera ab <initium>‥<finis> per <gradus> <var> { … } -- half-open range step
#
# GRAMMAR:
# iterStmt :← 'itera' 'ab' expr '‥' expr 'per' expr binding block
#
# EXPECTED OUTPUT:
# 0, 2, 4, 6 (step by 2 over 0‥8).
main {
# i = 0, 2, 4, 6 (step by 2)
for range 0‥8 step 2 const i {
print i
}
}Expected output:
0
2
4
6