ก่อน
Translation status: ภาษาไทย reader-locale proof. Term names and code fences follow the th-TH pack; supporting prose may still be English.
Creates an exclusive range with a Latin keyword.
Syntax: <expression> ก่อน <expression>
Category#
range
Related#
Examples#
radix/corpus/ante/ante.fab (canonical · keyword)#
Creates an exclusive range with a Latin keyword.
# =============================================================================
# ก่อน — Creates an exclusive range with a Latin keyword.
# =============================================================================
#
# What this teaches:
# • Exclusive range iteration — `ช่วง <initium> ก่อน <finis>` iterates from
# initium up to (but not including) finis
# • Range keyword pattern — `ก่อน` provides a natural-language alternative
# to symbolic range syntax
#
# Common mistakes:
# • confusing `ก่อน` (exclusive upper bound) with `จนถึง` (inclusive) — `0 ก่อน 4` yields 0,1,2,3 while `0 จนถึง 4` yields 0,1,2,3,4
#
# See also: จนถึง, ‥
# =============================================================================
# ก่อน — exclusive upper bound for range iteration
#
# วน ช่วง <initium> ก่อน <finis> <var> { … }
#
# GRAMMAR:
# iterStmt :← 'วน' 'ช่วง' expr 'ก่อน' 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