string
Translation status: ภาษาไทย reader-locale proof. Code fences render through the th-TH pipeline; prose is canonical Latin.
Short quoted textus string literals and template application.
Aliases: \"...\"
Syntax: \"<text>\"
Category#
literal
Related#
Examples#
radix/corpus/literalia/textus.fab (canonical · existing-home)#
Short quoted textus string literals and template application.
# =============================================================================
# string — Short quoted textus string literals and template application.
# =============================================================================
#
# What this teaches:
# • double-quoted string literals `"..."` — the standard textus syntax
# • template application with `§` placeholders — `"Salve, §!"(nomen)`
#
# Common mistakes:
# • Applying template § to ascii or octeti literals — template application works only on textus ("...") string literals.
#
# See also: block-string, §, textus
# =============================================================================
# literalia/textus — "..." string literals
#
# GRAMMAR:
# stringLit :← '"' ... '"'
# templateApp :← stringLit '(' expr (',' expr)* ')'
#
# EXPECTED OUTPUT:
# Salve, Salve, Mundus!
main {
const _ greeting ← "Salve"
print greeting
const _ nomen ← "Mundus"
const _ message ← "Salve, §!"(nomen)
print message
}Expected output:
Salve
Salve, Mundus!