trước
Translation status: Tiếng Việt reader-locale proof. Term names and code fences follow the vi pack; supporting prose may still be English.
Creates an exclusive range with a Latin keyword.
Syntax: <expression> trước <expression>
Category#
range
Related#
Examples#
radix/corpus/ante/ante.fab (canonical · keyword)#
Creates an exclusive range with a Latin keyword.
# =============================================================================
# trước — Creates an exclusive range with a Latin keyword.
# =============================================================================
#
# What this teaches:
# • Exclusive range iteration — `khoảng <initium> trước <finis>` iterates from
# initium up to (but not including) finis
# • Range keyword pattern — `trước` provides a natural-language alternative
# to symbolic range syntax
#
# Common mistakes:
# • confusing `trước` (exclusive upper bound) with `tới` (inclusive) — `0 trước 4` yields 0,1,2,3 while `0 tới 4` yields 0,1,2,3,4
#
# See also: tới, ‥
# =============================================================================
# trước — exclusive upper bound for range iteration
#
# lặp khoảng <initium> trước <finis> <var> { … }
#
# GRAMMAR:
# iterStmt :← 'lặp' 'khoảng' expr 'trước' expr binding '{' stmt* '}'
#
# EXPECTED OUTPUT:
# none
main {
# i = 0, 1, 2, 3 (stops before 4)
for range 0 before 4 const i {
print i
}
}Expected output:
0
1
2
3