ab
Translation status: ภาษาไทย reader-locale proof. Code fences render through the th-TH pipeline; prose is canonical Latin.
Selects numeric range iteration in an itera loop.
Syntax: itera ab <range> <binding>
Category#
iteration
Related#
Examples#
radix/corpus/ab/ab.fab (canonical · keyword)#
Selects numeric range iteration in an itera loop.
# =============================================================================
# ab — Selects numeric range iteration in an itera loop.
# =============================================================================
#
# What this teaches:
# • `itera ab` bounded range iteration — iterates over a numeric range with
# an optional step
# • Step syntax — the `per <step>` clause controls stride within the range
#
# Common mistakes:
# • using the retired `ab`/`ubi` collection pipeline DSL; use ordinary collection methods and closures instead
#
# See also: itera, ex, de, per, ab pipeline
# =============================================================================
# ab — bounded iteration step
#
# GRAMMAR:
# iteraStmt :← 'itera' 'ab' expr '‥' expr step? 'fixum' ident block
#
# EXPECTED OUTPUT:
# Scalar stdout smoke (see body).
#
main {
for range 0‥10 step 2 const i {
print i
}
}Expected output:
0
2
4
6
8