Kết xuấtvi

ad

Translation status: Tiếng Việt reader-locale proof. Code fences render through the vi pipeline; prose is canonical Latin.

ad opens a sermo endpoint and materializes the stream with an explicit conversio target.

Syntax: ad 'runtime:echo' (payload) ↦ textus

Category#

endpoint

Examples#

radix/corpus/ad/sermo-conversio.fab (canonical · keyword)#

ad opens a sermo endpoint and materializes the stream with an explicit conversio target.

# =============================================================================
# ad — ad opens a sermo endpoint and materializes the stream with an explicit
# conversio target.
# =============================================================================
#
# What this teaches:
#   • Endpoint materialization — `ad 'runtime:echo'(payload) ↦ textus` opens a
#     sermo connection and converts the stream to a concrete type
#   • The `↦` materialization operator — directs how the inbound frame stream
#     is interpreted
#
# Common mistakes:
#   • confusing ad route syntax — the materialization target type must match the endpoint's actual return shape
#
# See also: conversio
# =============================================================================

# Exemplar: expression `ad` with `sermo ↦ textus` materialization.
#
# Proves the conversio returns the echoed opener text as a `textus` value.
# The runtime:echo backend echoes the opener back as a single textus frame;
# `↦ textus` materializes it. The exemplar asserts equality.

main {
    const string t  call 'runtime:echo' ("salve, munde") ↦ string
    assert t  "salve, munde"
}

Expected output: