لاشيء
Translation status: العربية reader-locale proof. Term names and code fences follow the ar pack; supporting prose may still be English.
Represents the null value and can prefix a null check.
Syntax: نوع_لاشيء [<expression>]
Category#
literal
Related#
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