การเรนเดอร์th-TH

รอแปร

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 a mutable name.

Aliases: await_var

Syntax: รอแปร T name ← future

Category#

async

Examples#

radix/corpus/variandum/variandum.fab (canonical · keyword)#

Awaits a คำมั่น and binds a mutable name.

# =============================================================================
# รอแปร — Await-bind mutable
# =============================================================================
#
# What this teaches:
#   • Await a `คำมั่น<T>` and bind the success value mutably.
#
# See also: รอคง, รอทิ้ง, อะซิงก์, คำมั่น
# =============================================================================

ฟังก์ชัน responde() อะซิงก์ → จํานวน {
    คืน 3
}

เริ่มอะซิงก์ {
    รอแปร จํานวน responsum ← responde()
    responsum ← responsum + 1
    บันทึก responsum
}

Expected output:

4