Renderingen-US

Experimental through version 1. Version 0 was alpha. This is the first language release: the interface is relatively stable, not frozen. Nothing is promised stable until version 2.

scriptum-display-option

Translation status: English reader-locale proof. Term names and code fences follow the en pack; supporting prose may still be English.

A § slot shows an option exactly as print does: an absent option as none, a present one as its value.

Syntax: \"<template>\"(<option>)

Category#

format

Examples#

radix/corpus/reference/concept/scriptum-display-option/scriptum-display-option.fab (canonical · concept)#

A § slot shows an option exactly as print does: an absent option as none, 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 `none`, 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: format, 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 {
    let int ∪ none absent ← null
    let int ∪ none present ← 4
    print "absent=§"(absent)
    print "present=§"(present)
    print absent
    print present
}

Expected output:

absent=none
present=4
none
4