लिखित
Creates a formatted string with `§` placeholders.
Translation status: हिन्दी reader-locale proof. Term names and code fences follow the hi 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