การเรนเดอร์th-TH

อื่น

Translation status: ภาษาไทย reader-locale proof. Term names and code fences follow the th-TH 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