रेंडरिंगhi

शून्य

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

Represents the null value and can prefix a null check.

Syntax: शून्य_मान [<expression>]

Category#

literal

Examples#

radix/corpus/literalia/nihil.fab (canonical · keyword)#

Null literal and nullable union bindings.

# =============================================================================
# शून्य_मान — Null literal and nullable union bindings.
# =============================================================================
#
# What this teaches:
#   • the `शून्य_मान` literal — represents absence of a value (null)
#   • nullable union types with `∪` — `T ∪ शून्य_मान` for values that may be absent
#   • null checks with `est शून्य_मान` and `नहीं est शून्य_मान`
#
# Common mistakes:
#   • Using शून्य_मान without declaring the type as T ∪ शून्य_मान — शून्य_मान requires a nullable union type.
#
# See also: ∪, स्वेच्छा, शून्य_मान
# =============================================================================

# literalia/nihil — शून्य_मान literal and T ∪ शून्य_मान
#
# GRAMMAR:
#   literal :← 'शून्य_मान'
#   unionType :← type '∪' 'शून्य_मान'
#
# EXPECTED OUTPUT:
#   शून्य_मान, सत्य, 42
#
# BACKEND:
#   Cross-ref शून्य_मान/nihil.fab.

fn maybe() → int ∪ none {
    return 42
}

main {
    const int ∪ none absent ← null
    print absent
    const bool nihilne ← absent is none
    print nihilne
    print maybe() not is none
}

Expected output:

nihil
verum
verum

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

Represents the null value and can prefix a null check.

# =============================================================================
# शून्य_मान — Represents the null value and can prefix a null check.
# =============================================================================
#
# What this teaches:
#   • the `शून्य_मान` keyword — used for null/none values
#
# Common mistakes:
#   • Using शून्य_मान without ∪ in the type position — nullable types must be declared as T ∪ शून्य_मान.
#
# See also: ∪, स्वेच्छा
# =============================================================================

# शून्य_मान — null literal
#
# GRAMMAR:
#   literal :← 'शून्य_मान'
#
# EXPECTED OUTPUT:
#   Scalar stdout smoke (see body).
#

main {
    const none nothing ← null
    print nothing
}

Expected output:

nihil