مستقبل
Translation status: العربية reader-locale proof. Term names and code fences follow the ar pack; supporting prose may still be English.
Compatibility annotation for asynchronous posture.
Syntax: @ مستقبل
Category#
async
Related#
- futura
- annotation-sugar
Examples#
radix/corpus/annotation-sugar/futura-braced.fab (canonical · annotation)#
Braced canonical @ مستقبل unit marker.
@ future { }
fn f() → void {
return
}
main {
print "futura-braced"
}Expected output:
futura-braced
radix/corpus/futura/futura.fab (canonical · annotation)#
Compatibility annotation for asynchronous posture.
# =============================================================================
# مستقبل — Compatibility annotation for asynchronous posture
# =============================================================================
#
# What this teaches:
# • Preferred async posture — write `غيرمتزامن` for a finite async function.
# • Compatibility annotation — `@ مستقبل` remains accepted and preserved as
# the legacy spelling for async posture.
# • Related keywords: cursor, انتظر_ثابت, انتظر
#
# Common mistakes:
# • Calling an async function and forgetting to consume the وعد with
# `انتظر_ثابت`, `انتظر_متغير`, `أعد_منتظرا`, or `انتظر`.
#
# See also: cursor, انتظر_ثابت, انتظر
# =============================================================================
# @ مستقبل — compatibility async function annotation
#
# @ مستقبل
# دالة اسم(…) → نمط { … }
#
# GRAMMAR:
# annotatedFunc :← '@' 'مستقبل' funcDecl
# callablePosture :← 'غيرمتزامن'
#
# EXPECTED OUTPUT:
# none — Rust async runtime whitelist (compile-only in harness)
#
# BACKEND:
# Rust async runtime not linked in exempla harness (whitelist: مستقبل/futura.fab).
@ future { }
fn responde() → int {
return 42
}
async_main {
# انتظر_ثابت awaits the وعد and binds the resolved value
await_const int responsum ← responde()
print responsum
}Expected output:
42