Kết xuấtvi

integratio

Translation status: Tiếng Việt reader-locale proof. Term names and code fences follow the vi pack; supporting prose may still be English.

Minimal multi-feature happy path across hàm, hằng, nếu, and ghi_chú.

Syntax: integratio — multi-feature happy path

Category#

integration

Examples#

radix/corpus/integratio/minimum-smoke.fab (canonical · concept)#

Minimal multi-feature happy path across hàm, hằng, nếu, and ghi_chú.

# =============================================================================
# integratio — Minimal multi-feature happy path across hàm, hằng, nếu, and ghi_chú
# =============================================================================
#
# What this teaches:
#   • Minimal multi-feature happy path across hàm, hằng, nếu, and ghi_chú.
#   • Related keywords: hàm, hằng, nếu, ghi_chú
#
# Common mistakes:
#   • Writing code outside `bắt_đầu` that produces side effects — top-level code runs at module load; prefer `bắt_đầu` for program entry.
#
# See also: hàm, hằng, nếu, ghi_chú
# =============================================================================

# integratio — minimal multi-feature happy path
#
# hàm name(params) → type { … }
# hằng _ n ← expr
# nếu <cond> { … }
# ghi_chú template with § interpolation
#
# GRAMMAR:
#   funcDecl   :← 'hàm' ident '(' params ')' ('→' type)? block
#   condStmt   :← 'nếu' expr block
#   outputStmt :← 'ghi_chú' expr
#
# EXPECTED OUTPUT:
#   minimum-smoke.expected — par 42 when n is even.

fn par(int n) → bool {
    return n % 2 ≡ 0
}

main {
    const int n ← 42
    if par(n) {
        print "par §"(n)
    }
}

Expected output:

par 42