रेंडरिंगhi

में

Translation status: हिन्दी reader-locale proof. Term names and code fences follow the hi 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