cursor
Translation status: العربية reader-locale proof. Term names and code fences follow the ar pack; supporting prose may still be English.
Compatibility annotation for stream/generator posture.
Syntax: @ cursor
Category#
async
Related#
Examples#
radix/corpus/cursor/cursor.fab (canonical · keyword)#
Compatibility annotation for stream/generator posture.
# =============================================================================
# cursor — Compatibility annotation for stream/generator posture.
# =============================================================================
#
# What this teaches:
# • Preferred stream posture — write `مولد` for a synchronous stream or
# `مولد_غيرمتزامن` for an asynchronous stream.
# • Compatibility annotation — `@ cursor` remains accepted and preserved as
# the legacy spelling for stream/generator posture.
#
# Common mistakes:
# • Using `سلم` outside a stream body — `سلم` is valid only inside `مولد`
# or `مولد_غيرمتزامن` bodies, including compatible `@ cursor` declarations.
#
# See also: مولد, مولد_غيرمتزامن, سلم
# =============================================================================
# cursor — compatibility stream annotation
#
# GRAMMAR:
# annotation :← '@' 'cursor'
# callablePosture :← 'مولد' | 'مولد_غيرمتزامن'
#
# EXPECTED OUTPUT:
# Scalar stdout smoke (see body).
#
# BACKEND:
# Cross-ref: مستقبل/futura.fab, كرر/cursor-iteratio.fab; Go whitelist: cursor/cursor.fab.
#
@ cursor { }
fn stream() → int {
yield 1
yield 2
}
main {
print stream()
}Expected output:
[1, 2]