จารึก
Creates a formatted string with `§` placeholders.
Translation status: ภาษาไทย reader-locale proof. Term names and code fences follow the th-TH pack; supporting prose may still be English.
Creates a formatted string with § placeholders.
Syntax: \"<template>\"(<args>...)
Category#
format
Related#
Examples#
radix/corpus/scriptum/scriptum.fab (canonical · keyword)#
Creates a formatted string with § placeholders.
# =============================================================================
# จารึก — Creates a formatted string with `§` placeholders.
# =============================================================================
#
# What this teaches:
# • String template interpolation — `"template § and §"(arg1, arg2)` replaces
# `§` placeholders with positional arguments
# • Templates can contain any expression as an argument, not just variables
#
# Common mistakes:
# • Confusing `จารึก` (template desugaring into function calls) with bare `§` interpolation outside of the template syntax.
#
# See also: อ่าน, บรรทัด
# =============================================================================
# จารึก — 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 ผลรวม string.
main {
const string ชื่อ ← "Marcus"
const int aetas ← 30
# One slot
const string salutatio ← "Salve, §!"(ชื่อ)
print salutatio
# Multiple slots
const string notitia ← "§ habet annos §"(ชื่อ, aetas)
print notitia
# With an expression
const string ผลรวม ← "10 + 20 ← §"(10 + 20)
print ผลรวม
}Expected output:
Salve, Marcus!
Marcus habet annos 30
10 + 20 ← 30