Kết xuấtvi

tới

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 inclusive range with a Latin keyword.

Syntax: <expression> tới <expression>

Category#

range

Examples#

radix/corpus/usque/usque.fab (canonical · keyword)#

Creates an inclusive range with a Latin keyword.

# =============================================================================
# tới — Creates an inclusive range with a Latin keyword.
# =============================================================================
#
# What this teaches:
#   • Inclusive range — `khoảng <initium> tới <finis>` iterates including both endpoints
#   • Range iteration — combining `lặp` with `tới` for bounded loops
#
# Common mistakes:
#   • confusing tới (inclusive range bound) with trong_khi (loop) or miền (range type)
#
# See also: trước, …
# =============================================================================




# tới — inclusive upper bound for range iteration
#
# lặp khoảng <initium> tới <finis> <var> { … }   -- both endpoints included
#
# GRAMMAR:
#   iterStmt :← 'lặp' 'khoảng' expr 'tới' 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