عن
Translation status: العربية reader-locale proof. Term names and code fences follow the ar pack; supporting prose may still be English.
Introduces borrowed iteration or borrowed parameters.
Syntax: عن <expression>
Category#
iteration
Related#
Examples#
radix/corpus/de/de.fab (canonical · keyword)#
Introduces borrowed iteration or borrowed parameters.
# =============================================================================
# عن — Introduces borrowed iteration or borrowed parameters.
# =============================================================================
#
# What this teaches:
# • Borrowed iteration — `كرر عن <expr> ثابت <ident> { ... }` iterates over a collection without taking ownership.
# • Tabula key iteration — iterating over جدول keys via borrowed iteration.
# • Index iteration — iterating over قائمة indices via `عن`.
#
# Common mistakes:
# • Passing a `عن` parameter to an `في` or `من` position — mode mismatch; cannot pass a read-only reference where mutation or consumption is expected (SEM057).
#
# See also: من, in
# =============================================================================
# عن — borrowed iteration / parameters
#
# GRAMMAR:
# forDeStmt :← 'كرر' 'عن' expr 'ثابت' ident block
#
# EXPECTED OUTPUT:
# Scalar stdout smoke (see body).
#
# BACKEND:
# Cross-ref: كرر/de.fab.
#
main {
const map<string, int> persona ← { "nomen": 1, "aetas": 30 }
for ref persona const clavis {
print clavis
}
const list<int, 3> numeri ← [10, 20, 30]
for ref numeri const index {
print index
}
}radix/corpus/itera/de.fab (canonical · keyword)#
Introduces borrowed iteration or borrowed parameters.
# =============================================================================
# عن — Introduces borrowed iteration or borrowed parameters.
# =============================================================================
#
# What this teaches:
# • borrowed iteration (`كرر عن`) over جدول keys and قائمة indices — iterates without consuming the collection
# • accessing values by key or index within a borrowed loop
#
# Common mistakes:
# • Using عن (key/index iteration) when من (value iteration) is needed, or vice versa — عن iterates keys/indices, من iterates values.
#
# See also: من, in
# =============================================================================
# كرر عن — for-in key and index iteration
#
# كرر عن <كائن> ثابت <key> { <body> }
# كرر عن <قائمة> ثابت <index> { <body> }
#
# GRAMMAR:
# forDeStmt :← 'كرر' 'عن' expr 'ثابت' ident block
#
# EXPECTED OUTPUT:
# none — stdout not pinned for this exemplum.
main {
# Iterate over جدول keys
const map<string, string> persona ← { "nomen": "Marcus", "urbs": "Roma" }
for ref persona const clavis {
print clavis
}
# Access values using the key
for ref persona const clavis {
print clavis, persona[clavis]
}
# Iterate over قائمة indices
const list<int, 3> numeri ← [10, 20, 30]
for ref numeri const index {
print "index: § valor: §"(index, numeri[index])
}
# With numerus-valued جدول
const map<string, int> forma ← { "alpha": 1, "beta": 2 }
for ref forma const k {
print k
}
}