scriptum-display-option
Translation status: Tiếng Việt reader-locale proof. Term names and code fences follow the vi pack; supporting prose may still be English.
A § slot shows an option exactly as print does: an absent option as rỗng_ty, a present one as its value.
Syntax: \"<template>\"(<option>)
Category#
format
Related#
Examples#
radix/corpus/scriptum/scriptum-display-option.fab (canonical · concept)#
A § slot shows an option exactly as print does: an absent option as rỗng_ty, a present one as its value.
# =============================================================================
# scriptum-display-option — an option in a `§` slot
# =============================================================================
#
# What this teaches:
# • An absent option placed in a `§` slot reads `rỗng_ty`, exactly as a bare
# `print` of it does; a present option reads as the value it holds.
#
# Common mistakes:
# • Expecting the host language's spelling of an absent value (`null`,
# `nil`, `None`) in the template text.
#
# See also: văn_bản_hóa, scriptum-display
# =============================================================================
# scriptum-display-option — absent and present options inside `§` slots
#
# EXPECTED OUTPUT:
# scriptum-display-option.expected — each template line, then the same values printed alone.
main {
const int ∪ none absent ← null
const int ∪ none present ← 4
print "absent=§"(absent)
print "present=§"(present)
print absent
print present
}Expected output:
absent=nihil
present=4
nihil
4