string
Translation status: 简体中文 reader-locale proof. Term names and code fences follow the zh-Hans pack; supporting prose may still be English.
Short quoted 文本 string literals and template application.
Aliases: \"...\"
Syntax: \"<text>\"
Category#
literal
Related#
Examples#
radix/corpus/literalia/textus.fab (canonical · existing-home)#
Short quoted 文本 string literals and template application.
# =============================================================================
# string — Short quoted 文本 string literals and template application.
# =============================================================================
#
# What this teaches:
# • double-quoted string literals `"..."` — the standard 文本 syntax
# • template application with `§` placeholders — `"Salve, §!"(名称)`
#
# Common mistakes:
# • Applying template § to 窄字串 or 字节 literals — template application works only on 文本 ("...") string literals.
#
# See also: block-string, §, 文本
# =============================================================================
# literalia/textus — "..." string literals
#
# GRAMMAR:
# stringLit :← '"' ... '"'
# templateApp :← stringLit '(' expr (',' expr)* ')'
#
# EXPECTED OUTPUT:
# Salve, Salve, Mundus!
main {
const string greeting ← "Salve"
print greeting
const string 名称 ← "Mundus"
const string message ← "Salve, §!"(名称)
print message
}Expected output:
Salve
Salve, Mundus!