รอคืน
Translation status: ภาษาไทย reader-locale proof. Term names and code fences follow the th-TH pack; supporting prose may still be English.
Awaits a คำมั่น and returns its success value from a อะซิงก์ body.
Aliases: return_await
Syntax: รอคืน future
Category#
async
Related#
Examples#
radix/corpus/reddet/reddet.fab (canonical · keyword)#
Awaits a คำมั่น and returns its success value from a อะซิงก์ body.
# =============================================================================
# รอคืน — Await-return
# =============================================================================
#
# What this teaches:
# • Await and return from a `อะซิงก์` function only (`รอคืน future`).
#
# See also: รอคง, รอทิ้ง, อะซิงก์, คืน
# =============================================================================
ฟังก์ชัน interior() อะซิงก์ → จํานวน {
คืน 9
}
ฟังก์ชัน exterior() อะซิงก์ → จํานวน {
รอคืน interior()
}
เริ่มอะซิงก์ {
รอคง จํานวน v ← exterior()
บันทึก v
}Expected output:
9