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.

string

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

Short quoted string string literals and template application.

Aliases: \"...\"

Syntax: \"<text>\"

Category#

literal

Examples#

radix/corpus/reference/existing-home/string/textus.fab (canonical · existing-home)#

Short quoted string string literals and template application.

# =============================================================================
# string — Short quoted string string literals and template application.
# =============================================================================
#
# What this teaches:
#   • double-quoted string literals `"..."` — the standard string syntax
#   • template application with `§` placeholders — `"Salve, §!"(name)`
#
# Common mistakes:
#   • Applying template § to ascii or list<b8> literals — template application works only on string ("...") string literals.
#
# See also: block-string, §, string
# =============================================================================

# literalia/textus — "..." string literals
#
# GRAMMAR:
#   stringLit :← '"' ... '"'
#   templateApp :← stringLit '(' expr (',' expr)* ')'
#
# EXPECTED OUTPUT:
#   Salve, Salve, Mundus!

main {
    let string greeting ← "Salve"
    print greeting
    let string name ← "Mundus"
    let string message ← "Salve, §!"(name)
    print message
}

Expected output:

Salve
Salve, Mundus!