العرضar

في

Translation status: العربية reader-locale proof. Term names and code fences follow the ar pack; supporting prose may still be English.

Marks a mutable borrowed parameter.

Syntax: in <type> <name>

Category#

function

Examples#

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

Marks a mutable borrowed parameter.

# =============================================================================
# in — Marks a mutable borrowed parameter
# =============================================================================
#
# What this teaches:
#   • Marks a mutable borrowed parameter.
#   • Related keywords: عن, من
#
# Common mistakes:
#   • Mode mismatch — passing a `عن` (read-only) value to an `في` position, or using `في` to mutate a parameter declared as `عن` (SEM057).
#
# See also: عن, من
# =============================================================================

# in — value parameter passing mode
#
# GRAMMAR:
#   paramMode :← 'in' type
#
# EXPECTED OUTPUT:
#   Scalar stdout smoke (see body).
#
# BACKEND:
#   Cross-ref: دالة/in-ex.fab.
#

fn المجموع(mut list<int> values) → int {
    return values.sum()
}

main {
    const _ xs ← [1, 2, 3]
    print المجموع(xs)
}

Expected output:

6