tự_nguyện
Translation status: Tiếng Việt reader-locale proof. Term names and code fences follow the vi pack; supporting prose may still be English.
Marks a named declaration slot (parameter or kiểu field) as voluntary — the caller or provider may omit the value.
Aliases: optional, voluntary
Syntax: <type> <name> tự_nguyện [= default | hoặc_nếu_rỗng default]
Category#
declaration
Related#
Examples#
radix/corpus/sponte/sponte.fab (canonical · keyword)#
Marks a named declaration slot (parameter or kiểu field) as voluntary — the caller or provider may omit the value.
# =============================================================================
# tự_nguyện — Marks a named declaration slot (parameter or kiểu field) as voluntary — the caller or provider may omit the value.
# =============================================================================
#
# What this teaches:
# • Voluntary parameter syntax — using `tự_nguyện` to mark function parameters or kiểu fields as optional
# • Default values — combining `tự_nguyện` with `vel` to provide fallbacks when the value is omitted
#
# Common mistakes:
# • confusing tự_nguyện (optional parameter with a default) with ∪ rỗng_ty (nullable type) — tự_nguyện marks omission, ∪ rỗng_ty marks absence
#
# See also: vel, rỗng_ty, ∪, hàm, kiểu
# =============================================================================
# tự_nguyện — optional parameter / field marker
#
# GRAMMAR:
# optionalMarker :← 'tự_nguyện'
#
# EXPECTED OUTPUT:
# No bắt_đầu — declaration or test-runner surface only.
#
# BACKEND:
# declaration-only optional slots (whitelist: tự_nguyện/sponte.fab). Cross-ref: optionalis/optionalis.fab.
#
fn greet(string tên, string titulus optional) → string {
return tên
}
fn paginate(int pagina optional coalesce 1) → string {
return "page"
}
class User {
var string name
var string email optional
}