اقرأ
Translation status: العربية reader-locale proof. Term names and code fences follow the ar pack; supporting prose may still be English.
Reads input from the active input stream.
Syntax: اقرأ [سطرا]
Category#
io
Related#
Examples#
radix/corpus/lege/lege.fab (canonical · keyword)#
Reads input from the active input stream.
# =============================================================================
# اقرأ — Reads input from the active input stream.
# =============================================================================
#
# What this teaches:
# • stdin input with `اقرأ` — reads one line from the active input stream
# • the `↦ تعبير` حوّل — compiling a نص pattern into a تعبير value
#
# Common mistakes:
# • Not checking is null before using the value — read may return null at end of input.
#
# See also: سطرا, اكتب
# =============================================================================
# اقرأ and تعبير تحويل — I/O read and compiled pattern expressions
#
# ثابت _ pattern ← "\d+" ↦ تعبير -- compiled تعبير from نص
# ثابت _ input ← اقرأ -- stdin line read
#
# GRAMMAR:
# تحويل :← stringLit '↦' 'تعبير'
# readExpr :← 'اقرأ'
#
# EXPECTED OUTPUT:
# Regex pattern diagnostic, then one stdin line (no .expected — interactive).
#
# BACKEND: Rust/Go/roundtrip e2e whitelist — اقرأ not yet lowered for Rust/Go
# (whitelist: اقرأ/lege.fab).
main {
const تعبير pattern ← "(?i)\d+" ↦ تعبير
print pattern
const string ∪ none input ← read
print input
}