↢
Translation status: English reader-locale proof. Term names and code fences follow the en pack; supporting prose may still be English.
Awaits a promise while initializing an ordinary binding.
Syntax: let T name ↢ future
Category#
async
Related#
Examples#
radix/corpus/reference/operator/await-assign/await-assignment.fab (canonical · operator)#
Awaits a promise while initializing an ordinary binding.
# =============================================================================
# ↢ — Await-directed binding initializer
# =============================================================================
#
# What this teaches:
# • Keep const, mut, or let while awaiting the initializer.
# • The glyph is a binding boundary, not an inline expression operator.
# • A stored promise can be resolved in a later declaration.
#
# See also: await_const, await_var, async, promise
# =============================================================================
fn responde(int value) async → int {
return value
}
async_main {
let promise<int> todo ← responde(7)
let int immotum ↢ todo
mut int mutabile ↢ responde(8)
let _ illatum ↢ responde(9)
mutabile ← mutabile + 1
print immotum
print mutabile
print illatum
}Expected output:
7
9
9