Marks a function as a generator.
Syntax: @ cursor
Category
async
Related
Examples
examples/corpus/cursor/cursor.fab (canonical · keyword)
Marks a function as a generator.
# cursor — async iteration annotation
#
# GRAMMAR:
# annotation :← '@' 'cursor'
#
# EXPECTED OUTPUT:
# Scalar stdout smoke (see body).
#
# BACKEND:
# Cross-ref: futura/futura.fab, itera/cursor-iteratio.fab; Go whitelist: cursor/cursor.fab.
#
@ cursor
functio stream() → numerus {
cede 1
cede 2
}
incipit {
nota stream()
}Expected output:
[1, 2]