รอคง
Translation status: ภาษาไทย reader-locale proof. Term names and code fences follow the th-TH pack; supporting prose may still be English.
Awaits a คำมั่น and binds an immutable name.
Aliases: await_const
Syntax: รอคง T name ← future
Category#
async
Related#
Examples#
radix/corpus/figendum/figendum.fab (canonical · keyword)#
Awaits a คำมั่น and binds an immutable name.
# =============================================================================
# รอคง — Await-bind immutable
# =============================================================================
#
# What this teaches:
# • Await a `คำมั่น<T>` and bind the success value immutably.
# • Valid in `อะซิงก์` / `สตรีมอะซิงก์` / `เริ่มอะซิงก์` contexts.
#
# See also: รอแปร, รอทิ้ง, รอคืน, อะซิงก์, คำมั่น
# =============================================================================
# GRAMMAR:
# awaitBind :← 'รอคง' type? IDENT '←' expr
ฟังก์ชัน responde() อะซิงก์ → จํานวน {
คืน 7
}
เริ่มอะซิงก์ {
รอคง จํานวน responsum ← responde()
บันทึก responsum
}Expected output:
7