到
Translation status: 简体中文 reader-locale proof. Term names and code fences follow the zh-Hans pack; supporting prose may still be English.
Creates an inclusive range with a Latin keyword.
Syntax: <expression> 到 <expression>
Category#
range
Related#
- 迄
- …
Examples#
radix/corpus/usque/usque.fab (canonical · keyword)#
Creates an inclusive range with a Latin keyword.
# =============================================================================
# 到 — Creates an inclusive range with a Latin keyword.
# =============================================================================
#
# What this teaches:
# • Inclusive range — `范围 <initium> 到 <finis>` iterates including both endpoints
# • Range iteration — combining `遍历` with `到` for bounded loops
#
# Common mistakes:
# • confusing 到 (inclusive range bound) with 当 (loop) or 区间 (range type)
#
# See also: 迄, …
# =============================================================================
# 到 — inclusive upper bound for range iteration
#
# 遍历 范围 <initium> 到 <finis> <var> { … } -- both endpoints included
#
# GRAMMAR:
# iterStmt :← '遍历' '范围' expr '到' expr binding block
#
# EXPECTED OUTPUT:
# 0, 1, 2, 3 (inclusive range through finis).
main {
# i = 0, 1, 2, 3 (includes 3)
for range 0 until 3 const i {
print i
}
}Expected output:
0
1
2
3