อนาคต
Translation status: ภาษาไทย reader-locale proof. Term names and code fences follow the th-TH pack; supporting prose may still be English.
Compatibility annotation for asynchronous posture.
Syntax: @ อนาคต
Category#
async
Related#
- futura
- annotation-sugar
Examples#
radix/corpus/annotation-sugar/futura-braced.fab (canonical · annotation)#
Braced canonical @ อนาคต unit marker.
@ future { }
fn f() → void {
return
}
main {
print "futura-braced"
}Expected output:
futura-braced
radix/corpus/futura/futura.fab (canonical · annotation)#
Compatibility annotation for asynchronous posture.
# =============================================================================
# อนาคต — Compatibility annotation for asynchronous posture
# =============================================================================
#
# What this teaches:
# • Preferred async posture — write `อะซิงก์` for a finite async function.
# • Compatibility annotation — `@ อนาคต` remains accepted and preserved as
# the legacy spelling for async posture.
# • Related keywords: เคอร์เซอร์, รอคง, รอทิ้ง
#
# Common mistakes:
# • Calling an async function and forgetting to consume the คำมั่น with
# `รอคง`, `รอแปร`, `รอคืน`, or `รอทิ้ง`.
#
# See also: เคอร์เซอร์, รอคง, รอทิ้ง
# =============================================================================
# @ อนาคต — compatibility async function annotation
#
# @ อนาคต
# ฟังก์ชัน ชื่อ(…) → ชนิดนามแฝง { … }
#
# GRAMMAR:
# annotatedFunc :← '@' 'อนาคต' funcDecl
# callablePosture :← 'อะซิงก์'
#
# EXPECTED OUTPUT:
# none — Rust async runtime whitelist (compile-only in harness)
#
# BACKEND:
# Rust async runtime not linked in exempla harness (whitelist: อนาคต/futura.fab).
@ future { }
fn responde() → int {
return 42
}
async_main {
# รอคง awaits the คำมั่น and binds the resolved value
await_const int responsum ← responde()
print responsum
}Expected output:
42