रेंडरिंगhi

बैठा

Translation status: हिन्दी reader-locale proof. Term names and code fences follow the hi pack; supporting prose may still be English.

Declares an inferred immutable local.

Syntax: बैठा <name> [← <expression>]

Category#

binding

Examples#

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

Declares an inferred immutable local.

# =============================================================================
# बैठा — Declares an inferred immutable local.
# =============================================================================
#
# What this teaches:
#   • Immutable binding sugar — `बैठा name` is a compact alternative to
#     `स्थिर _ name` for inferred-type immutable locals
#   • Supports immediate init (`बैठा x ← expr`) and deferred init
#     (`बैठा x` then `x ← expr` later)
#
# Common mistakes:
#   • Confusing `बैठा` (sugar for `स्थिर _`) with `चर` — `बैठा` creates an immutable binding.
#
# See also: स्थिर, चर, ←
# =============================================================================



# बैठा — inferred immutable bindings
#
# Immediate init:
#   बैठा नाम ← expr        -- compact sugar for स्थिर _ नाम ← expr
#
# Deferred init:
#   बैठा नाम               -- compact sugar for स्थिर _ नाम (assign once later)
#   नाम ← expr
#
# Prefer बैठा when a block chains several inferred locals; keep स्थिर _ when
# teaching the explicit infer marker or mixing typed and inferred bindings.
#
# GRAMMAR:
#   sitDecl := 'बैठा' IDENTIFIER ('←' expression)?
#
# EXPECTED OUTPUT:
#   sit.expected

main {
    let salve ← "Salve"
    let नाम ← "Marcus"
    let nuntius ← "§, §!"(salve, नाम)

    print nuntius

    let label
    label ← "deferred"
    print label

    const _ idem ← nuntius
    print idem
}

Expected output:

Salve, Marcus!
deferred
Salve, Marcus!