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

อะซิงก์

Translation status: ภาษาไทย reader-locale proof. Term names and code fences follow the th-TH pack; supporting prose may still be English.

Callable posture for asynchronous finite functions.

Aliases: async

Syntax: ฟังก์ชัน name(…) อะซิงก์ → T

Category#

async

Examples#

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

Callable posture for asynchronous finite functions.

# =============================================================================
# อะซิงก์ — Asynchronous finite callable posture
# =============================================================================
#
# What this teaches:
#   • Preferred async posture word after the parameter list: `อะซิงก์ → T`.
#   • Return type is observed as `คำมั่น<T>` at call sites.
#   • Consume with `รอคง`, `รอแปร`, `รอคืน`, or `รอทิ้ง`.
#
# Common mistakes:
#   • Using bare `ให้` to await — await is not yield; use await morphology.
#
# See also: อนาคต, คำมั่น, รอคง, รอทิ้ง
# =============================================================================

# GRAMMAR:
#   callablePosture :← 'อะซิงก์'
#
# EXPECTED OUTPUT:
#   42

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

เริ่มอะซิงก์ {
    รอคง _ responsum ← responde()
    บันทึก responsum
}

Expected output:

42