văn_bản_hóa
Creates a formatted string with `§` placeholders.
Translation status: Tiếng Việt reader-locale proof. Term names and code fences follow the vi 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.
# =============================================================================
# văn_bản_hóa — 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 `văn_bản_hóa` (template desugaring into function calls) with bare `§` interpolation outside of the template syntax.
#
# See also: đọc, dòng
# =============================================================================
# văn_bản_hóa — 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 tổng string.
main {
const string tên ← "Marcus"
const int aetas ← 30
# One slot
const string salutatio ← "Salve, §!"(tên)
print salutatio
# Multiple slots
const string notitia ← "§ habet annos §"(tên, aetas)
print notitia
# With an expression
const string tổng ← "10 + 20 ← §"(10 + 20)
print tổng
}Expected output:
Salve, Marcus!
Marcus habet annos 30
10 + 20 ← 30