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.

§

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

String-template substitution holes inside quoted literals.

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

Category#

format

Examples#

radix/corpus/reference/operator-group/text-hole/metadata.fab (canonical · operator-group)#

String-template substitution holes inside quoted literals.

# =============================================================================
# § — String-template substitution holes inside quoted literals.
# =============================================================================
#
# What this teaches:
#   • String interpolation — `§` marks substitution holes in string literals, filled by parenthesized arguments.
#   • Template syntax — `"Salve, §!"(name)` replaces `§` with the value of `name`.
#
# Common mistakes:
#   • Forgetting that arguments come after the string in parentheses, not inline with § inside the string.
#
# See also: string, write
# =============================================================================

# operatores/metadata — § string templates
#
# GRAMMAR:
#   stringTemplate :← stringLit '(' expr (',' expr)* ')'
#
# EXPECTED OUTPUT:
#   Salve, Marcus!, 1 + 2 = 3
#
# BACKEND:
#   Per-file metadata belongs in +++ frontmatter, not line-start § directives.

main {
    let string name ← "Marcus"
    print "Salve, §!"(name)
    print "§ + § = §"(1, 2, 3)
}

Expected output:

Salve, Marcus!
1 + 2 = 3