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

สมัครใจ

Translation status: ภาษาไทย reader-locale proof. Term names and code fences follow the th-TH pack; supporting prose may still be English.

Marks a named declaration slot (parameter or ชนิด field) as voluntary — the caller or provider may omit the value.

Aliases: optional, voluntary

Syntax: <type> <name> สมัครใจ [= default | หรือว่าง default]

Category#

declaration

Examples#

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

Marks a named declaration slot (parameter or ชนิด field) as voluntary — the caller or provider may omit the value.

# =============================================================================
# สมัครใจ — Marks a named declaration slot (parameter or ชนิด field) as voluntary — the caller or provider may omit the value.
# =============================================================================
#
# What this teaches:
#   • Voluntary parameter syntax — using `สมัครใจ` to mark function parameters or ชนิด fields as optional
#   • Default values — combining `สมัครใจ` with `vel` to provide fallbacks when the value is omitted
#
# Common mistakes:
#   • confusing สมัครใจ (optional parameter with a default) with ∪ นัล (nullable type) — สมัครใจ marks omission, ∪ นัล marks absence
#
# See also: vel, นัล, ∪, ฟังก์ชัน, ชนิด
# =============================================================================



# สมัครใจ — optional parameter / field marker
#
# GRAMMAR:
#   optionalMarker :← 'สมัครใจ'
#
# EXPECTED OUTPUT:
#   No เริ่ม — declaration or test-runner surface only.
#
# BACKEND:
#   declaration-only optional slots (whitelist: สมัครใจ/sponte.fab). Cross-ref: optionalis/optionalis.fab.
#

fn greet(string ชื่อ, string titulus optional) → string {
    return ชื่อ
}

fn paginate(int pagina optional coalesce 1) → string {
    return "page"
}

class User {
    var string name
    var string email optional
}