العرضar

افتراضي

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

Starts the default branch of an اختر or طابق statement.

Aliases: default

Syntax: افتراضي <block>

Category#

control-flow

Examples#

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

Starts the default branch of an اختر or طابق statement.

# =============================================================================
# افتراضي — Starts the default branch of an اختر or طابق statement.
# =============================================================================
#
# What this teaches:
#   • Default arm — `افتراضي <block>` is the catch-all branch in an `اختر`
#     or `طابق` match expression
#   • Fallback handling — when no `حالة` pattern matches, execution falls
#     through to the `افتراضي` block
#
# Common mistakes:
#   • using `افتراضي` with `طابق الكل` — `الكل` forbids catchall arms and requires listing every variant explicitly (SEM044)
#
# See also: اختر, طابق
# =============================================================================

# افتراضي — default اختر arm
#
# GRAMMAR:
#   defaultClause :← 'افتراضي' block
#
# EXPECTED OUTPUT:
#   Scalar stdout smoke (see body).
#
# BACKEND:
#   Cross-ref: اختر/ceterum.fab.
#

main {
    const _ وسم ← "z"
    switch وسم {
        case "a" { print "a" }
        default { print "default" }
    }
}

Expected output:

default