العرضar

انتظر_متغير

Translation status: العربية reader-locale proof. Term names and code fences follow the ar 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