đợi_trả
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 returns its success value from a async body.
Aliases: return_await
Syntax: đợi_trả future
Category#
async
Related#
Examples#
radix/corpus/reddet/reddet.fab (canonical · keyword)#
Awaits a lời_hứa and returns its success value from a async body.
# =============================================================================
# đợi_trả — Await-return
# =============================================================================
#
# What this teaches:
# • Await and return from a `async` function only (`đợi_trả future`).
#
# See also: đợi_hằng, đợi_bỏ, async, trả
# =============================================================================
hàm interior() async → số {
trả 9
}
hàm exterior() async → số {
đợi_trả interior()
}
bắt_đầu_bất_đồng_bộ {
đợi_hằng số v ← exterior()
ghi_chú v
}Expected output:
9