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.

named-holes

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

Named template holes, positional rendering, and forma capture.

Syntax: \"§{label} …\"(label: value)

Category#

literal

Examples#

radix/corpus/reference/existing-home/named-holes/named-holes.fab (canonical · existing-home)#

Named template holes, positional rendering, and forma capture.

# =============================================================================
# named-holes — Named template holes and erased positional rendering.
# =============================================================================
#
# What this teaches:
#   • named-only template application: "§{greet} world"(greet: "Salve")
#   • mixed named and anonymous STRING holes with positional actuals
#   • forma capture with a labeled actual; the captured template is erased to §
#   • named holes erase before rendering, so the output is ordinary text
#
# Reject teaching rows (comments only; these must not become stage-3 inputs):
#   • ordinary-call label: f(greet: "x")
#   • `=` form: "§ world"(greet = "x")
#   • unknown label: "§{greet} world"(other: "x")
#
# See also: forma, format, string, string, §
# =============================================================================

main {
    # A labeled actual fills the named hole.
    let _ named ← "§{greet} world"(greet: "Salve")
    print named

    # A named and an anonymous hole share one positional sequence.
    let _ mixed ← "§{greet} §"("Salve", "Mundus")
    print mixed

    # Named-hole erasure renders the same as the positional § form.
    let _ erased ← "§{greet} world"("Salve")
    print erased

    # Forma capture accepts labels but stores only erased template text.
    let _ captured ← `where id = §{id}`(id: "42")
    print captured.template

    # An indexed hole selects its argument and may repeat; one value serves all
    # occurrences of its number.
    print "§0, §0, §0, and §1"("her", "me")

    # The selection follows the hole number, not left-to-right order.
    print "§1 then §0"("a", "b")
}

Expected output:

Salve world
Salve Mundus
Salve world
where id = §
her, her, her, and me
b then a