العرضar

integratio

Translation status: العربية reader-locale proof. Term names and code fences follow the ar pack; supporting prose may still be English.

Minimal multi-feature happy path across دالة, ثابت, إذا, and اعرض.

Syntax: integratio — multi-feature happy path

Category#

integration

Examples#

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

Minimal multi-feature happy path across دالة, ثابت, إذا, and اعرض.

# =============================================================================
# integratio — Minimal multi-feature happy path across دالة, ثابت, إذا, and اعرض
# =============================================================================
#
# What this teaches:
#   • Minimal multi-feature happy path across دالة, ثابت, إذا, and اعرض.
#   • Related keywords: دالة, ثابت, إذا, اعرض
#
# Common mistakes:
#   • Writing code outside `بداية` that produces side effects — top-level code runs at module load; prefer `بداية` for program entry.
#
# See also: دالة, ثابت, إذا, اعرض
# =============================================================================

# integratio — minimal multi-feature happy path
#
# دالة name(params) → type { … }
# ثابت _ n ← expr
# إذا <cond> { … }
# اعرض template with § interpolation
#
# GRAMMAR:
#   funcDecl   :← 'دالة' ident '(' params ')' ('→' type)? block
#   condStmt   :← 'إذا' expr block
#   outputStmt :← 'اعرض' 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