การเรนเดอร์th-TH

เคอร์เซอร์

Translation status: ภาษาไทย reader-locale proof. Term names and code fences follow the th-TH pack; supporting prose may still be English.

Compatibility annotation for stream/generator posture.

Syntax: @ เคอร์เซอร์

Category#

async

Examples#

radix/corpus/cursor/cursor.fab (canonical · keyword)#

Compatibility annotation for stream/generator posture.

# =============================================================================
# เคอร์เซอร์ — Compatibility annotation for stream/generator posture.
# =============================================================================
#
# What this teaches:
#   • Preferred stream posture — write `สตรีม` for a synchronous stream or
#     `สตรีมอะซิงก์` for an asynchronous stream.
#   • Compatibility annotation — `@ เคอร์เซอร์` 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 `@ เคอร์เซอร์` declarations.
#
# See also: สตรีม, สตรีมอะซิงก์, ให้
# =============================================================================

# เคอร์เซอร์ — compatibility stream annotation
#
# GRAMMAR:
#   annotation :← '@' 'เคอร์เซอร์'
#   callablePosture :← 'สตรีม' | 'สตรีมอะซิงก์'
#
# EXPECTED OUTPUT:
#   Scalar stdout smoke (see body).
#
# BACKEND:
#   Cross-ref: อนาคต/futura.fab, วน/cursor-iteratio.fab; Go whitelist: เคอร์เซอร์/cursor.fab.
#

@ เคอร์เซอร์ { }
fn stream() → int {
    yield 1
    yield 2
}

main {
    print stream()
}

Expected output:

[1, 2]