đợi_hằng
Translation status: Tiếng Việt reader-locale proof. Term names and code fences follow the vi pack; supporting prose may still be English.
Awaits a lời_hứa and binds an immutable name.
Aliases: await_const
Syntax: đợi_hằng T name ← future
Category#
async
Related#
Examples#
radix/corpus/figendum/figendum.fab (canonical · keyword)#
Awaits a lời_hứa and binds an immutable name.
# =============================================================================
# đợi_hằng — Await-bind immutable
# =============================================================================
#
# What this teaches:
# • Await a `lời_hứa<T>` and bind the success value immutably.
# • Valid in `async` / `async_sinh` / `bắt_đầu_bất_đồng_bộ` contexts.
#
# See also: đợi_biến, đợi_bỏ, đợi_trả, async, lời_hứa
# =============================================================================
# GRAMMAR:
# awaitBind :← 'đợi_hằng' type? IDENT '←' expr
hàm responde() async → số {
trả 7
}
bắt_đầu_bất_đồng_bộ {
đợi_hằng số responsum ← responde()
ghi_chú responsum
}Expected output:
7