Kết xuấtvi

ante

Translation status: Tiếng Việt reader-locale proof. Code fences render through the vi pipeline; prose is canonical Latin.

Creates an exclusive range with a Latin keyword.

Syntax: <expression> ante <expression>

Category#

range

Examples#

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

Creates an exclusive range with a Latin keyword.

# =============================================================================
# ante — Creates an exclusive range with a Latin keyword.
# =============================================================================
#
# What this teaches:
#   • Exclusive range iteration — `ab <initium> ante <finis>` iterates from
#     initium up to (but not including) finis
#   • Range keyword pattern — `ante` provides a natural-language alternative
#     to symbolic range syntax
#
# Common mistakes:
#   • confusing `ante` (exclusive upper bound) with `usque` (inclusive) — `0 ante 4` yields 0,1,2,3 while `0 usque 4` yields 0,1,2,3,4
#
# See also: usque, ‥
# =============================================================================

# ante — exclusive upper bound for range iteration
#
# itera ab <initium> ante <finis> <var> { … }
#
# GRAMMAR:
#   iterStmt :← 'itera' 'ab' expr 'ante' 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