Renderingla

scriptum

Creates a formatted string with § placeholders.

Syntax: \"<template>\"(<args>...)

Category

format

Related

Examples

examples/corpus/scriptum/scriptum.fab (canonical · keyword)

Creates a formatted string with § placeholders.

# scriptum — string-template interpolation ("§" slots)
#
# "literal § more §"(arg1, arg2)   -- each § replaced by the corresponding arg
#
# GRAMMAR:
#   templateExpr :← stringLit '(' exprList ')'
#
# EXPECTED OUTPUT:
#   Salve greeting, persona notice, and computed summa string.

incipit {
    fixum _ nomen ← "Marcus"
    fixum _ aetas ← 30

    # One slot
    fixum _ salutatio ← "Salve, §!"(nomen)
    nota salutatio

    # Multiple slots
    fixum _ notitia ← "§ habet annos §"(nomen, aetas)
    nota notitia

    # With an expression
    fixum _ summa ← "10 + 20 ← §"(10 + 20)
    nota summa
}

Expected output:

Salve, Marcus!
Marcus habet annos 30
10 + 20 ← 30